lib/package_register.c: make sure to error out if copy fails

This commit is contained in:
Duncan Overbruck 2020-02-10 00:29:45 +01:00
parent dca2223cb7
commit aa4d726dca
No known key found for this signature in database
GPG Key ID: 335C1D17EC3D6E35

View File

@ -48,7 +48,9 @@ xbps_register_pkg(struct xbps_handle *xhp, xbps_dictionary_t pkgrd)
assert(xbps_object_type(pkgrd) == XBPS_TYPE_DICTIONARY);
xbps_dictionary_make_immutable(pkgrd);
pkgd = xbps_dictionary_copy_mutable(pkgrd);
if ((pkgd = xbps_dictionary_copy_mutable(pkgrd)) == NULL) {
goto out;
}
xbps_dictionary_get_cstring_nocopy(pkgd, "pkgver", &pkgver);
if (!xbps_pkg_name(pkgname, sizeof(pkgname), pkgver)) {