xbps_remove_pkg: make sure pkgver is valid before use.

pkgver might contain garbage due to removal of
its ancestor object (the pkg dictionary).
This commit is contained in:
Juan RP 2020-01-25 13:58:00 +01:00
parent 6e6a9294a7
commit ead62bdc7c
No known key found for this signature in database
GPG Key ID: AF19F6CB482F9368

View File

@ -255,9 +255,9 @@ purge:
/* /*
* Unregister package from pkgdb. * Unregister package from pkgdb.
*/ */
xbps_dictionary_remove(xhp->pkgdb, pkgname);
xbps_dbg_printf(xhp, "[remove] unregister %s returned %d\n", pkgver, rv); xbps_dbg_printf(xhp, "[remove] unregister %s returned %d\n", pkgver, rv);
xbps_set_cb_state(xhp, XBPS_STATE_REMOVE_DONE, 0, pkgver, NULL); xbps_set_cb_state(xhp, XBPS_STATE_REMOVE_DONE, 0, pkgver, NULL);
xbps_dictionary_remove(xhp->pkgdb, pkgname);
out: out:
if (pkgname != NULL) if (pkgname != NULL)
free(pkgname); free(pkgname);