libpkgconf: path: fix memory leak when deduping paths (closes #39)

feature/tap-sh
Ariadne Conill 2019-07-11 03:38:58 -05:00
parent 03e5d0fd31
commit 7e0b0fadab
1 changed files with 5 additions and 0 deletions

View File

@ -95,8 +95,13 @@ pkgconf_path_add(const char *text, pkgconf_list_t *dirlist, bool filter)
char *linkdest = realpath(path, NULL);
if (linkdest != NULL && stat(linkdest, &st) == -1)
{
free(linkdest);
return;
}
free(linkdest);
}
if (path_list_contains_entry(path, dirlist, &st))
return;
}