mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
zipl: don't leak @script_file
... ==9448== 32 bytes in 1 blocks are definitely lost in loss record 1 of 3 ==9448== at 0x4831010: malloc (vg_replace_malloc.c:309) ==9448== by 0x48E2205: __vasprintf_internal (vasprintf.c:71) ==9448== by 0x1005061: misc_asprintf (misc.c:48) ==9448== by 0x10131F3: disk_get_info (disk.c:239) ==9448== by 0x1013C41: disk_get_info_from_file (disk.c:517) ==9448== by 0x1011C87: bootmap_create (bootmap.c:1127) ==9448== by 0x1004C73: main (zipl.c:192) ... Signed-off-by: Marc Hartmayer <mhartmay@linux.ibm.com> Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
committed by
Jan Höppner
parent
1d25112589
commit
fe457e2082
+3
-1
@@ -198,7 +198,7 @@ disk_get_info(const char* device, struct job_target_data* target,
|
||||
long devsize;
|
||||
FILE *fh;
|
||||
char *script_pre = TOOLS_LIBDIR "/zipl_helper.";
|
||||
char *script_file;
|
||||
char *script_file = NULL;
|
||||
char *ppn_cmd = NULL;
|
||||
char buffer[80];
|
||||
char value[40];
|
||||
@@ -443,10 +443,12 @@ type_determined:
|
||||
data->fs_block_size = -1;
|
||||
close(fd);
|
||||
*info = data;
|
||||
free(script_file);
|
||||
return 0;
|
||||
out_close:
|
||||
close(fd);
|
||||
free(ppn_cmd);
|
||||
free(script_file);
|
||||
free(data);
|
||||
return -1;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user