Closed potential memory leaks. Thanks Eliska Svobodova.

This commit is contained in:
Thomas Schmitt 2019-08-14 11:40:53 +02:00
parent b356291700
commit 3eba8cc921
4 changed files with 7 additions and 6 deletions

View File

@ -1034,8 +1034,7 @@ int Xorriso_genisofs_hide_list(struct XorrisO *xorriso, char *whom,
}
ret= 1;
ex:;
if(flag & 1)
Xorriso_read_lines(xorriso, fp, &linecount, &argc, &argv, 2);
Xorriso_read_lines(xorriso, fp, &linecount, &argc, &argv, 2);
if(fp != NULL && fp != stdin)
fclose(fp);
if(ret<=0)

View File

@ -218,8 +218,7 @@ ex:;
xorriso->allow_graft_points= allow_graft_points_mem;
Sfile_make_argv("", "", &argc, &argv, 2);
Xorriso_free_meM(pathspec);
if(flag & 1)
Xorriso_read_lines(xorriso, fp, &linecount, &argc, &argv, 2);
Xorriso_read_lines(xorriso, fp, &linecount, &argc, &argv, 2);
if(fp != NULL && fp != stdin)
fclose(fp);

View File

@ -725,8 +725,11 @@ int Xorriso_read_lines(struct XorrisO *xorriso, FILE *fp, int *linecount,
if(*argv == NULL)
{ret= -1; goto ex;}
(*argv)[0]= strdup(line);
if((*argv)[0] == NULL)
if((*argv)[0] == NULL) {
free(*argv);
(*argv)= NULL;
{ret= -1; goto ex;}
}
*argc= 1;
}
ret= 1;

View File

@ -1 +1 @@
#define Xorriso_timestamP "2019.08.13.161913"
#define Xorriso_timestamP "2019.08.14.094038"