Prevented use of uninitialized variable in case of memory shortage. Coverity CID 28801.

This commit is contained in:
Thomas Schmitt 2015-11-06 12:34:16 +00:00
parent 9a8865d818
commit bdfd7a60e4
2 changed files with 7 additions and 14 deletions

View File

@ -1372,13 +1372,9 @@ int Xorriso_show_du_subs(struct XorrisO *xorriso, IsoDir *dir_node,
off_t sub_size, report_size, mem= 0; off_t sub_size, report_size, mem= 0;
char *path= NULL, *show_path= NULL, *sfe= NULL; char *path= NULL, *show_path= NULL, *sfe= NULL;
sfe= malloc(5*SfileadrL); Xorriso_alloc_meM(sfe, char, 5 * SfileadrL);
path= malloc(SfileadrL); Xorriso_alloc_meM(path, char, SfileadrL);
show_path= malloc(SfileadrL); Xorriso_alloc_meM(show_path, char, SfileadrL);
if(path==NULL || show_path==NULL || sfe==NULL) {
Xorriso_no_malloc_memory(xorriso, &sfe, 0);
{ret= -1; goto ex;}
}
*size= 0; *size= 0;
ret= iso_dir_get_children(dir_node, &iter); ret= iso_dir_get_children(dir_node, &iter);
@ -1490,12 +1486,9 @@ much_too_long:;
} }
ret= 1; ret= 1;
ex:; ex:;
if(sfe!=NULL) Xorriso_free_meM(sfe);
free(sfe); Xorriso_free_meM(path);
if(path!=NULL) Xorriso_free_meM(show_path);
free(path);
if(show_path!=NULL)
free(show_path);
if(iter!=NULL) if(iter!=NULL)
iso_dir_iter_free(iter); iso_dir_iter_free(iter);
if(node_array!=NULL) if(node_array!=NULL)

View File

@ -1 +1 @@
#define Xorriso_timestamP "2015.11.06.092940" #define Xorriso_timestamP "2015.11.06.123344"