lib/package_configure.c: fix use-after-free reported by clang.

This commit is contained in:
Juan RP 2014-04-19 15:49:02 +02:00
parent 5c3c192d16
commit 4bc6ba2b1c

View File

@ -96,9 +96,9 @@ xbps_configure_pkg(struct xbps_handle *xhp,
} }
pkgd = xbps_pkgdb_get_pkg(xhp, pkgname); pkgd = xbps_pkgdb_get_pkg(xhp, pkgname);
if (pkgd == NULL) { if (pkgd == NULL) {
free(pkgname);
xbps_dbg_printf(xhp, "[configure] cannot find %s (%s) " xbps_dbg_printf(xhp, "[configure] cannot find %s (%s) "
"in pkgdb\n", pkgname, pkgver); "in pkgdb\n", pkgname, pkgver);
free(pkgname);
return ENOENT; return ENOENT;
} }