cppchecker fix, realloc should already freed it
This commit is contained in:
@@ -106,7 +106,7 @@ int searchHomeFilePath(char **foundpath, const char *subdir, const char *filenam
|
|||||||
pathlen += strlen(subdir);
|
pathlen += strlen(subdir);
|
||||||
char *tmp = realloc(path, pathlen * sizeof(char));
|
char *tmp = realloc(path, pathlen * sizeof(char));
|
||||||
if (tmp == NULL) {
|
if (tmp == NULL) {
|
||||||
free(path);
|
//free(path);
|
||||||
return PM3_EMALLOC;
|
return PM3_EMALLOC;
|
||||||
}
|
}
|
||||||
path = tmp;
|
path = tmp;
|
||||||
@@ -146,7 +146,7 @@ int searchHomeFilePath(char **foundpath, const char *subdir, const char *filenam
|
|||||||
pathlen += strlen(filename);
|
pathlen += strlen(filename);
|
||||||
char *tmp = realloc(path, pathlen * sizeof(char));
|
char *tmp = realloc(path, pathlen * sizeof(char));
|
||||||
if (tmp == NULL) {
|
if (tmp == NULL) {
|
||||||
free(path);
|
//free(path);
|
||||||
return PM3_EMALLOC;
|
return PM3_EMALLOC;
|
||||||
}
|
}
|
||||||
path = tmp;
|
path = tmp;
|
||||||
|
|||||||
Reference in New Issue
Block a user