xbps_remove_pkg: do not pass dangling pointers to state cb after removing pkgdict.
This commit is contained in:
parent
f1ad8a95de
commit
abdf6e710d
5
NEWS
5
NEWS
@ -1,3 +1,8 @@
|
|||||||
|
xbps-0.16.2 (???):
|
||||||
|
|
||||||
|
* libxbps: after removing a pkg the state cb was passing dangling pointers in
|
||||||
|
its pkgname and version members.
|
||||||
|
|
||||||
xbps-0.16.1 (2012-06-30):
|
xbps-0.16.1 (2012-06-30):
|
||||||
|
|
||||||
* xbps-repo(8): fixed a regression in the 'genindex' target. It was looking
|
* xbps-repo(8): fixed a regression in the 'genindex' target. It was looking
|
||||||
|
@ -271,7 +271,8 @@ xbps_remove_pkg(struct xbps_handle *xhp,
|
|||||||
bool soft_replace)
|
bool soft_replace)
|
||||||
{
|
{
|
||||||
prop_dictionary_t pkgd = NULL;
|
prop_dictionary_t pkgd = NULL;
|
||||||
char *buf = NULL, *pkgver = NULL;
|
char *tmpname = NULL, *buf = NULL, *pkgver = NULL;
|
||||||
|
const char *tmpver = NULL;
|
||||||
int rv = 0;
|
int rv = 0;
|
||||||
bool rmfile_exists = false;
|
bool rmfile_exists = false;
|
||||||
pkg_state_t state = 0;
|
pkg_state_t state = 0;
|
||||||
@ -438,8 +439,14 @@ purge:
|
|||||||
if ((rv = xbps_unregister_pkg(xhp, pkgname, version, false)) != 0)
|
if ((rv = xbps_unregister_pkg(xhp, pkgname, version, false)) != 0)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
|
tmpname = xbps_pkg_name(pkgver);
|
||||||
|
assert(tmpname);
|
||||||
|
tmpver = xbps_pkg_version(pkgver);
|
||||||
|
assert(tmpver);
|
||||||
|
|
||||||
xbps_set_cb_state(xhp, XBPS_STATE_REMOVE_DONE,
|
xbps_set_cb_state(xhp, XBPS_STATE_REMOVE_DONE,
|
||||||
0, pkgname, version, NULL);
|
0, tmpname, tmpver, NULL);
|
||||||
|
free(tmpname);
|
||||||
|
|
||||||
out:
|
out:
|
||||||
if (buf != NULL)
|
if (buf != NULL)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user