Radish alpha
H
HardenedBSD Package Manager
Radicle
Git (anonymous pull)
Log in to clone via SSH
Fix a possible leak in libpkg/update.c
Marin Atanasov Nikolov committed 13 years ago
commit 18df571665ef3f24f57f942dfc667032fd9e75da
parent 2a9b57f9ca94aba4187860e351062326d7d4df90
1 file changed +6 -1
modified libpkg/update.c
@@ -149,8 +149,12 @@ pkg_update(const char *name, const char *packagesite, bool force)
		}
	}

-
	if (pkg_config_string(PKG_CONFIG_REPOKEY, &repokey) != EPKG_OK)
+
	if (pkg_config_string(PKG_CONFIG_REPOKEY, &repokey) != EPKG_OK) {
+
		if (sig != NULL)
+
			free(sig);
+
		
		return (EPKG_FATAL);
+
	}

	if (repokey != NULL) {
		if (sig != NULL) {
@@ -164,6 +168,7 @@ pkg_update(const char *name, const char *packagesite, bool force)
				rc = EPKG_FATAL;
				goto cleanup;
			}
+
			free(sig);
		} else {
			pkg_emit_error("No signature found in the repository.  "
			    "Can not validate against %s key.", repokey);