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

master
Thomas Schmitt 7 years ago
parent 52d09aaf24
commit 5b6481343f
  1. 24
      xorriso/disk_ops.c
  2. 2
      xorriso/xorriso_timestamp.h

@ -364,14 +364,10 @@ int Xorriso_show_dux_subs(struct XorrisO *xorriso,
namept= name;
*size= 0;
sfe= malloc(5*SfileadrL);
path= malloc(SfileadrL);
show_path= malloc(SfileadrL);
name= malloc(SfileadrL);
if(path==NULL || show_path==NULL || name==NULL || sfe==NULL) {
Xorriso_no_malloc_memory(xorriso, &sfe, 0);
{ret= -1; goto ex;}
}
Xorriso_alloc_meM(sfe, char, 5 * SfileadrL);
Xorriso_alloc_meM(path, char, SfileadrL);
Xorriso_alloc_meM(show_path, char, SfileadrL);
Xorriso_alloc_meM(name, char, SfileadrL);
if(lstat(abs_path, &stbuf)==-1)
{ret= 2; goto ex;}
@ -578,14 +574,10 @@ revoke_sorting:;
ret= 1;
ex:;
if(sfe!=NULL)
free(sfe);
if(path!=NULL)
free(path);
if(show_path!=NULL)
free(show_path);
if(name!=NULL)
free(name);
Xorriso_free_meM(sfe);
Xorriso_free_meM(path);
Xorriso_free_meM(show_path);
Xorriso_free_meM(name);
Linkitem_reset_stack(&own_link_stack, link_stack, 0);
Dirseq_destroy(&dirseq, 0);
if(filev!=NULL) {

@ -1 +1 @@
#define Xorriso_timestamP "2015.11.06.125101"
#define Xorriso_timestamP "2015.11.06.125705"

Loading…
Cancel
Save