Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
jobs: address potential memory leak
Baptiste Daroussin committed 2 years ago
commit 90596ed49b06910024e510108226568dab9b0168
parent 80bc349
1 file changed +3 -1
modified libpkg/pkg_jobs.c
@@ -1572,11 +1572,13 @@ pkg_jobs_find_install_candidates(struct pkg_jobs *j)
{
	struct pkg *pkg = NULL;
	struct pkgdb_it *it;
-
	candidates_t *candidates = xcalloc(1, sizeof(*candidates));
+
	candidates_t *candidates;

	if ((it = pkgdb_query(j->db, NULL, MATCH_ALL)) == NULL)
		return (NULL);

+
	candidates = xcalloc(1, sizeof(*candidates));
+

	while (pkgdb_it_next(it, &pkg, PKG_LOAD_BASIC) == EPKG_OK) {

		if ((j->flags & PKG_FLAG_FORCE) ||