libxbps: fixed multiple free(3) calls via closedir(3) in virtualpkg init in error paths.

This commit is contained in:
Juan RP 2011-10-26 16:16:09 +02:00
parent 807045d1d5
commit 94591775d5
2 changed files with 3 additions and 3 deletions

3
NEWS
View File

@ -1,5 +1,8 @@
xbps-0.11.0 (???): xbps-0.11.0 (???):
* libxbps: fixed multiple free(3)s (multiple closedir(3) calls)
when some virtualpkg plist file couldn't be internalized.
* xbps-bin(8): 'remove' with recursive flag (-R) now removes first * xbps-bin(8): 'remove' with recursive flag (-R) now removes first
the specified packages and puts its automatic dependencies at the the specified packages and puts its automatic dependencies at the
tail of the array. tail of the array.

View File

@ -82,7 +82,6 @@ xbps_init_virtual_pkgs(struct xbps_handle *xh)
vpkgfile = xbps_xasprintf("%s/%s", vpkgfile = xbps_xasprintf("%s/%s",
prop_string_cstring_nocopy(vpkgdir), dp->d_name); prop_string_cstring_nocopy(vpkgdir), dp->d_name);
if (vpkgfile == NULL) { if (vpkgfile == NULL) {
(void)closedir(dirp);
xbps_dbg_printf("%s: failed to alloc mem for %s\n", xbps_dbg_printf("%s: failed to alloc mem for %s\n",
__func__, dp->d_name); __func__, dp->d_name);
continue; continue;
@ -93,7 +92,6 @@ xbps_init_virtual_pkgs(struct xbps_handle *xh)
if (vpkgd == NULL) { if (vpkgd == NULL) {
xbps_dbg_printf("%s: failed to internalize %s: %s\n", xbps_dbg_printf("%s: failed to internalize %s: %s\n",
__func__, dp->d_name, strerror(errno)); __func__, dp->d_name, strerror(errno));
(void)closedir(dirp);
continue; continue;
} }
if (prop_object_type(xh->virtualpkgs_array) == PROP_TYPE_UNKNOWN) if (prop_object_type(xh->virtualpkgs_array) == PROP_TYPE_UNKNOWN)
@ -103,7 +101,6 @@ xbps_init_virtual_pkgs(struct xbps_handle *xh)
xbps_dbg_printf("%s: failed to add %s virtualpkg " xbps_dbg_printf("%s: failed to add %s virtualpkg "
"dictionary!\n", __func__, dp->d_name); "dictionary!\n", __func__, dp->d_name);
prop_object_release(vpkgd); prop_object_release(vpkgd);
(void)closedir(dirp);
continue; continue;
} }
xbps_dbg_printf("%s: added virtualpkg from: %s\n", xbps_dbg_printf("%s: added virtualpkg from: %s\n",