From ec7549fa04f42c942edf0a1a01a64a1fa98bb569 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Fri, 4 Feb 2011 16:17:47 +0100 Subject: [PATCH] xbps_sort_pkg_deps: change an assertion into a real check. --- lib/transaction_sortdeps.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/transaction_sortdeps.c b/lib/transaction_sortdeps.c index fdfe2846..d78597c4 100644 --- a/lib/transaction_sortdeps.c +++ b/lib/transaction_sortdeps.c @@ -203,7 +203,11 @@ again: } curpkgd = xbps_find_pkg_in_dict_by_name(transd, "unsorted_deps", pkgnamedep); - assert(curpkgd != NULL); + if (curpkgd == NULL) { + free(pkgnamedep); + rv = EINVAL; + break; + } lpd = pkgdep_alloc(curpkgd, pkgnamedep); if (lpd == NULL) { free(pkgnamedep);