lib/pkgdb.c: CID 62719 (NULL pointer dereference)

This commit is contained in:
Juan RP 2014-10-07 07:57:38 +02:00
parent 8d4a01baa4
commit 4be2a0ee84

View File

@ -319,7 +319,9 @@ xbps_pkgdb_get_pkg_revdeps(struct xbps_handle *xhp, const char *pkg)
generate_full_revdeps_tree(xhp); generate_full_revdeps_tree(xhp);
xbps_dictionary_get_cstring_nocopy(pkgd, "pkgver", &pkgver); xbps_dictionary_get_cstring_nocopy(pkgd, "pkgver", &pkgver);
pkgname = xbps_pkg_name(pkgver); if ((pkgname = xbps_pkg_name(pkgver)) == NULL)
return NULL;
res = xbps_dictionary_get(xhp->pkgdb_revdeps, pkgname); res = xbps_dictionary_get(xhp->pkgdb_revdeps, pkgname);
free(pkgname); free(pkgname);