Fixed a small memory leak introduced with commit aace531

This commit is contained in:
Thomas Schmitt 2024-05-19 09:41:04 +02:00
parent 4dc5edc565
commit 2ee32947de
2 changed files with 7 additions and 2 deletions

View File

@ -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);

View File

@ -1 +1 @@
#define Xorriso_timestamP "2024.05.13.101913"
#define Xorriso_timestamP "2024.05.19.074013"