Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Finish properly the sbuf and plug a leak
Baptiste Daroussin committed 11 years ago
commit 295f01fa1c8c59c4409b93446aeddcdc7d32f010
parent e6e64ff
1 file changed +4 -0
modified libpkg/fetch.c
@@ -575,6 +575,8 @@ pkg_fetch_file_to_fd(struct pkg_repo *repo, const char *url, int dest, time_t *t
		    u->host,
		    u->doc,
		    sbuf_data(fetchOpts));
+

+
		sbuf_finish(fetchOpts);
		
		remote = fetchXGet(u, &st, sbuf_data(fetchOpts));
		if (remote == NULL) {
@@ -658,6 +660,8 @@ pkg_fetch_file_to_fd(struct pkg_repo *repo, const char *url, int dest, time_t *t

	/* restore original doc */
	u->doc = doc;
+
	if (fetchOpts != NULL)
+
		sbuf_delete(fetchOpts);

	fetchFreeURL(u);