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,9 +616,11 @@ pkgconf_pkg_find(pkgconf_client_t *client, const char *name)
PKGCONF_TRACE(client, "%s is a file", name);
pkg = pkgconf_pkg_new_from_file(client, name, f);
pkgconf_path_add(pkg_get_parent_dir(pkg), &client->dir_list, true);
return pkg;
if (pkg != NULL)
{
pkgconf_path_add(pkg_get_parent_dir(pkg), &client->dir_list, true);
return pkg;
}
}
}

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