xbps_sort_pkg_deps: change an assertion into a real check.

This commit is contained in:
Juan RP 2011-02-04 16:17:47 +01:00
parent 097b50b3c2
commit ec7549fa04

View File

@ -203,7 +203,11 @@ again:
} }
curpkgd = xbps_find_pkg_in_dict_by_name(transd, curpkgd = xbps_find_pkg_in_dict_by_name(transd,
"unsorted_deps", pkgnamedep); "unsorted_deps", pkgnamedep);
assert(curpkgd != NULL); if (curpkgd == NULL) {
free(pkgnamedep);
rv = EINVAL;
break;
}
lpd = pkgdep_alloc(curpkgd, pkgnamedep); lpd = pkgdep_alloc(curpkgd, pkgnamedep);
if (lpd == NULL) { if (lpd == NULL) {
free(pkgnamedep); free(pkgnamedep);