Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix a fd leak
Baptiste Daroussin committed 10 years ago
commit 8ceb6590db55cb977b599c74401b55817ae725b4
parent 4308ff6
1 file changed +3 -2
modified libpkg/pkg_add.c
@@ -399,6 +399,9 @@ do_extract_regfile(struct pkg *pkg, struct archive *a, struct archive_entry *ae,
		    path, archive_error_string(a));
		return (EPKG_FATAL);
	}
+
	if (fd != -1) {
+
		close(fd);
+
	}

	if (set_attrs(pkg->rootfd, f->temppath, aest->st_mode,
	    get_uid_from_archive(ae), get_gid_from_archive(ae),
@@ -930,9 +933,7 @@ cleanup_reg:
		handle_rc = pkg_object_bool(pkg_config_get("HANDLE_RC_SCRIPTS"));
		if (handle_rc)
			pkg_start_stop_rc_scripts(pkg, PKG_RC_START);
-
	}

-
	if (retcode == EPKG_OK) {
		if ((flags & PKG_ADD_UPGRADE) == 0)
			pkg_emit_install_finished(pkg, local);
		else {