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:
parent
6e6a9294a7
commit
ead62bdc7c
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user