load_packages: fix memory leak on error

The memory assigned in _alpm_pkg_load_internal was not freed on
error.

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2022-12-13 00:43:43 +10:00
parent 19a8587459
commit 775d511f42

View file

@ -1109,6 +1109,7 @@ static int load_packages(alpm_handle_t *handle, alpm_list_t **data,
errors++;
*data = alpm_list_add(*data, strdup(spkg->filename));
free(filepath);
_alpm_pkg_free(pkgfile);
continue;
}
free(filepath);