forked from ariadne/pkgconf
libpkgconf: path: fix memory leak when deduping paths (closes #39)
parent
03e5d0fd31
commit
7e0b0fadab
|
@ -95,8 +95,13 @@ pkgconf_path_add(const char *text, pkgconf_list_t *dirlist, bool filter)
|
||||||
char *linkdest = realpath(path, NULL);
|
char *linkdest = realpath(path, NULL);
|
||||||
|
|
||||||
if (linkdest != NULL && stat(linkdest, &st) == -1)
|
if (linkdest != NULL && stat(linkdest, &st) == -1)
|
||||||
|
{
|
||||||
|
free(linkdest);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
free(linkdest);
|
||||||
|
}
|
||||||
if (path_list_contains_entry(path, dirlist, &st))
|
if (path_list_contains_entry(path, dirlist, &st))
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue