libpkgconf: pkgconf_pkg_find(): correctly handle failure from pkgconf_pkg_new_from_file()

pull/119/head
William Pitcock 2017-05-19 23:33:49 -05:00
parent cf3c50ca78
commit 0262b8251d
2 changed files with 7 additions and 3 deletions

View File

@ -616,11 +616,13 @@ pkgconf_pkg_find(pkgconf_client_t *client, const char *name)
PKGCONF_TRACE(client, "%s is a file", name); PKGCONF_TRACE(client, "%s is a file", name);
pkg = pkgconf_pkg_new_from_file(client, name, f); pkg = pkgconf_pkg_new_from_file(client, name, f);
if (pkg != NULL)
{
pkgconf_path_add(pkg_get_parent_dir(pkg), &client->dir_list, true); pkgconf_path_add(pkg_get_parent_dir(pkg), &client->dir_list, true);
return pkg; return pkg;
} }
} }
}
/* check builtins */ /* check builtins */
if ((pkg = pkgconf_builtin_pkg_get(name)) != NULL) if ((pkg = pkgconf_builtin_pkg_get(name)) != NULL)

View File

@ -0,0 +1,2 @@
prefix=/usr\nName: GKrellM\nDescription: Extensible GTK system monitoring application\nVersion: 2.3.7\nRequires: gtk+-2.0 >= 2.4.0\nCflags: -I/usr/include\n