Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Fix repo override crashing when URL is not defined.
Bryan Drewery committed 11 years ago
commit 6f4ae5cceda28570d104611979ecc23c890324ca
parent 9f54666
1 file changed +4 -2
modified libpkg/pkg_config.c
@@ -1045,9 +1045,11 @@ pkg_repo_overwrite(struct pkg_repo *r, const char *name, const char *url,
{

	free(r->name);
-
	free(r->url);
	r->name = strdup(name);
-
	r->url = strdup(url);
+
	if (url != NULL) {
+
		free(r->url);
+
		r->url = strdup(url);
+
	}
	r->ops = pkg_repo_find_type(type);
	HASH_DEL(repos, r);
	HASH_ADD_KEYPTR(hh, repos, r->name, strlen(r->name), r);