Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
repo: remove unused variable and plug a memory leak
Baptiste Daroussin committed 2 years ago
commit 6b4231075c1650dd917b3317b0158a3f15472c5a
parent e34f457
1 file changed +1 -5
modified libpkg/pkg_repo_create.c
@@ -311,13 +311,10 @@ pkg_create_repo_thread(void *arg)
	struct thr_env *te = (struct thr_env *)arg;
	int flags, ret = EPKG_OK;
	struct pkg *pkg = NULL;
-
	xstring *b;
	char *path;
	const char *repopath;
	struct pkg_fts_item *items = NULL;

-
	b = xstring_new();
-

	pkg_debug(1, "start worker to parse packages");

	if (te->ffd != -1)
@@ -377,6 +374,7 @@ pkg_create_repo_thread(void *arg)

				flock(te->ffd, LOCK_UN);
			}
+
			pkg_free(pkg);
		}
		pthread_mutex_lock(&te->nlock);
		te->ntask++;
@@ -385,8 +383,6 @@ pkg_create_repo_thread(void *arg)
	}

cleanup:
-
	xstring_free(b);
-

	pkg_debug(1, "worker done");
	return (NULL);
}