pacman/util.c: fix user after free in print_packages

Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
Allan McRae 2024-01-26 18:13:11 +10:00
parent 3c28c30133
commit 36fcff6e13

View file

@ -1262,6 +1262,7 @@ void print_packages(const alpm_list_t *packages)
string = strreplace(temp, "%s", size); string = strreplace(temp, "%s", size);
free(size); free(size);
free(temp); free(temp);
temp = string;
} }
/* %u : url */ /* %u : url */
PRINT_FORMAT_STRING(temp, "%u", alpm_pkg_get_url) PRINT_FORMAT_STRING(temp, "%u", alpm_pkg_get_url)