cppchecker fix, realloc should already freed it

This commit is contained in:
iceman1001 2021-01-28 14:33:30 +01:00
parent 2c73337bde
commit 56b4a480cd

View file

@ -106,7 +106,7 @@ int searchHomeFilePath(char **foundpath, const char *subdir, const char *filenam
pathlen += strlen(subdir);
char *tmp = realloc(path, pathlen * sizeof(char));
if (tmp == NULL) {
free(path);
//free(path);
return PM3_EMALLOC;
}
path = tmp;
@ -146,7 +146,7 @@ int searchHomeFilePath(char **foundpath, const char *subdir, const char *filenam
pathlen += strlen(filename);
char *tmp = realloc(path, pathlen * sizeof(char));
if (tmp == NULL) {
free(path);
//free(path);
return PM3_EMALLOC;
}
path = tmp;