pkg: plug some minor memory leaks

pull/4/head
William Pitcock 2012-05-02 19:35:45 +00:00
parent 77703f1841
commit 656b34fb45
1 changed files with 6 additions and 0 deletions

6
pkg.c
View File

@ -76,9 +76,15 @@ pkg_find(const char *name)
while (iter < count)
{
snprintf(locbuf, sizeof locbuf, "%s/%s" PKG_CONFIG_EXT, path[iter], name);
free(path[iter]);
if (f = fopen(locbuf, "r"))
return parse_file(locbuf, f);
iter++;
}
free(path);
}
snprintf(locbuf, sizeof locbuf, "%s/%s" PKG_CONFIG_EXT, PKG_DEFAULT_PATH, name);