mirror of
https://github.com/vivier/EMILE.git
synced 2025-03-11 08:32:45 +00:00
clear mallocated memory
This commit is contained in:
parent
f143ea45a2
commit
f112a09c5d
@ -109,13 +109,13 @@ int emile_scsi_create_container(int fd, short *unit_id,
|
||||
unsigned long first_block;
|
||||
int sector_size;
|
||||
int block_size;
|
||||
int sectors_per_block;
|
||||
unsigned long sectors_per_block;
|
||||
int current;
|
||||
int logical;
|
||||
int physical;
|
||||
int last_physical;
|
||||
int zone;
|
||||
int aggregate;
|
||||
unsigned long zone;
|
||||
unsigned long aggregate;
|
||||
|
||||
ret = fstat(fd, &st);
|
||||
if (ret == -1) {
|
||||
@ -177,7 +177,6 @@ int emile_scsi_create_container(int fd, short *unit_id,
|
||||
|
||||
/* end of list */
|
||||
|
||||
ADD_BLOCK(0, 0);
|
||||
|
||||
ADD_BLOCK(0L, 0L);
|
||||
return 0;
|
||||
}
|
||||
|
@ -11,6 +11,7 @@
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <linux/fs.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "libemile.h"
|
||||
|
||||
@ -47,6 +48,7 @@ struct emile_container *emile_second_create_mapfile(short *unit_id, char *mapfil
|
||||
close(fd);
|
||||
return NULL;
|
||||
}
|
||||
memset(container, 0, block_size);
|
||||
|
||||
|
||||
ret = emile_scsi_create_container(fd, &unit_id_map, container,
|
||||
@ -83,6 +85,7 @@ struct emile_container *emile_second_create_mapfile(short *unit_id, char *mapfil
|
||||
|
||||
/* now, we must know where is the map file */
|
||||
|
||||
memset(container, 0, block_size);
|
||||
fd = open(mapfile, O_RDONLY);
|
||||
if (fd == -1)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user