From 2ee32947de115adfd8249ca6196dd17de5a51811 Mon Sep 17 00:00:00 2001 From: Thomas Schmitt Date: Sun, 19 May 2024 09:41:04 +0200 Subject: [PATCH] Fixed a small memory leak introduced with commit aace531 --- xorriso/iso_img.c | 7 ++++++- xorriso/xorriso_timestamp.h | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/xorriso/iso_img.c b/xorriso/iso_img.c index 84890a81..e2a70869 100644 --- a/xorriso/iso_img.c +++ b/xorriso/iso_img.c @@ -1585,6 +1585,7 @@ struct elto_img_par { unsigned long int lba, extract_size; char pltf[8], b[8], emul[8], boot_image_type[16]; char *path, *id_string, *sel_crit; + int path_allocated; }; @@ -1929,6 +1930,7 @@ static int Xorriso_scan_report_lines(struct XorrisO *xorriso, Xorriso_alloc_meM(et_imgs, struct elto_img_par, elto_count); for(et_idx= 0; et_idx < elto_count; et_idx++) { et_imgs[et_idx].path= NULL; + et_imgs[et_idx].path_allocated= 0; et_imgs[et_idx].ldsiz= -1; } Xorriso_alloc_meM(app_pseudo_paths, char *, elto_count); @@ -2963,7 +2965,7 @@ static int Xorriso_scan_report_lines(struct XorrisO *xorriso, buf[0]= 0; continue; } - + et_imgs[idx].path_allocated= 1; } if (et_imgs[idx].path[0] == 0) { @@ -3114,6 +3116,9 @@ ex: Xorriso_free_meM(app_pseudo_paths[i]); Xorriso_free_meM(app_pseudo_paths); } + for(et_idx= 0; et_idx < elto_count; et_idx++) + if(et_imgs[et_idx].path_allocated) + Xorriso_free_meM(et_imgs[et_idx].path); Xorriso_free_meM(et_imgs); Xorriso_free_meM(lines); Xorriso_free_meM(buf); diff --git a/xorriso/xorriso_timestamp.h b/xorriso/xorriso_timestamp.h index 9bb0bc24..7f84d6b5 100644 --- a/xorriso/xorriso_timestamp.h +++ b/xorriso/xorriso_timestamp.h @@ -1 +1 @@ -#define Xorriso_timestamP "2024.05.13.101913" +#define Xorriso_timestamP "2024.05.19.074013"