cppchecker fix, realloc should already freed it
This commit is contained in:
1 parent
2c73337bde
commit
56b4a480cd
1 file changed
+2
-2
+2
-2
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user