Be a bit more paranoid by checking allocs and expected types.

This commit is contained in:
Juan RP
2011-12-22 08:23:11 +01:00
parent 1c6794a4e4
commit 5a892023f4
6 changed files with 30 additions and 15 deletions

View File

@ -138,7 +138,10 @@ find_orphan_pkg(prop_object_t obj, void *arg, bool *loop_done)
continue;
pkgdepname = xbps_pkg_name(pkgdep);
assert(pkgdepname != NULL);
if (pkgdepname == NULL) {
prop_object_iterator_release(iter);
return ENOMEM;
}
for (i = 0; i < prop_array_count(od->orphans_user); i++) {
prop_array_get_cstring_nocopy(od->orphans_user,
i, &curpkgname);