Stuffed memory leaks on -commit and loading of El Torito records

This commit is contained in:
Thomas Schmitt 2009-03-22 09:02:21 +00:00
parent bc1453ad0e
commit adff1dd16b
3 changed files with 11 additions and 5 deletions

View File

@ -3199,6 +3199,7 @@ int Exclusions_destroy(struct ExclusionS **o, int flag)
regfree((regex_t *) s->text);
Xorriso_lst_destroy(&s, 0);
}
free((char *) *o);
(*o)= NULL;
return(1);
}
@ -4149,7 +4150,9 @@ int Xorriso_new(struct XorrisO ** xorriso,char *progname, int flag)
m->problem_status= 0;
m->problem_status_text[0]= 0;
m->errfile_log[0]= 0;
m->errfile_mode= 0;
m->errfile_fp= NULL;
m->img_read_error_mode= 2; /* abort faulty image reading with FATAL */
m->extract_error_mode= 1; /* keep extracted files after read error */
strcpy(m->return_with_text, "SORRY");

View File

@ -1 +1 @@
#define Xorriso_timestamP "2009.03.20.193334"
#define Xorriso_timestamP "2009.03.22.090232"

View File

@ -457,6 +457,7 @@ int Xorriso_record_boot_info(struct XorrisO *xorriso, int flag)
return(0);
ret= iso_image_get_boot_image(image, &bootimg,
&bootimg_node, &bootcat_node);
iso_image_unref(image); /* release obtained reference */
if(ret != 1)
return(0);
if(bootimg_node != NULL)
@ -830,9 +831,9 @@ int Xorriso_give_up_drive(struct XorrisO *xorriso, int flag)
"on attempt to give up drive", 0);
if(!in_is_out_too) {
if(drive!=NULL && !in_is_out_too)
if(drive!=NULL)
isoburn_drive_release(drive,!!(flag&4));
if(dinfo!=NULL && !in_is_out_too)
if(dinfo!=NULL)
burn_drive_info_free(dinfo);
}
xorriso->in_drive_handle= NULL;
@ -1472,6 +1473,8 @@ ex:;
}
if(disc!=NULL)
burn_disc_free(disc);
if(image != NULL)
iso_image_unref(image);
isoburn_igopt_destroy(&sopts, 0);
Xorriso_process_msg_queues(xorriso,0);
return(ret);
@ -4121,7 +4124,7 @@ no_boot:;
/* Using the nodes with extreme care . They might be deleted meanwhile. */
ret= iso_image_get_boot_image(image, &bootimg, &bootimg_node, &bootcat_node);
iso_image_unref(image);
iso_image_unref(image); /* release obtained reference */
image= NULL;
if(ret != 1)
goto no_boot;
@ -5111,7 +5114,7 @@ int Xorriso_rmi(struct XorrisO *xorriso, void *boss_iter, off_t boss_mem,
char *sfe= NULL, *sub_path= NULL;
off_t mem;
IsoNode **node_array= NULL;
int node_count, node_idx;
int node_count= 0, node_idx;
/* Avoiding large local memory objects in order to save stack space */
sfe= malloc(5*SfileadrL);