xbps-remove(8): fix assertion when the cachedir is empty.

This commit is contained in:
Juan RP committed 2014-08-02 10:00:54 +02:00
1 parent df93e790a6
commit 766cbcf683
2 files changed
+7 -2

No files matched your search

+4 -2
View File
@@ -136,7 +136,9 @@ clean_cachedir(struct xbps_handle *xhp)
}
(void)closedir(dirp);
rv = xbps_array_foreach_cb_multi(xhp, array, NULL, cleaner_cb, NULL);
xbps_object_release(array);
if (xbps_array_count(array)) {
rv = xbps_array_foreach_cb_multi(xhp, array, NULL, cleaner_cb, NULL);
xbps_object_release(array);
}
return rv;
}