summaryrefslogtreecommitdiffstats
path: root/usr.sbin
diff options
context:
space:
mode:
authorglebius <glebius@FreeBSD.org>2013-11-14 09:26:52 +0000
committerglebius <glebius@FreeBSD.org>2013-11-14 09:26:52 +0000
commit0daddca6bd6e186a4f552d882e66a77e988b9dd1 (patch)
tree9c1176f4a560de4782235b8f5386f266547a48c1 /usr.sbin
parentbb108535bab90d3218195361ff0ccf6791178573 (diff)
downloadFreeBSD-src-0daddca6bd6e186a4f552d882e66a77e988b9dd1.zip
FreeBSD-src-0daddca6bd6e186a4f552d882e66a77e988b9dd1.tar.gz
Merge r257945 from head:
Do not use just freed memory. Approved by: re (kib)
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/pkg/pkg.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/pkg/pkg.c b/usr.sbin/pkg/pkg.c
index 100d881..8af31a7 100644
--- a/usr.sbin/pkg/pkg.c
+++ b/usr.sbin/pkg/pkg.c
@@ -326,9 +326,9 @@ parse_fingerprint(yaml_document_t *doc, yaml_node_t *node)
static void
free_fingerprint_list(struct fingerprint_list* list)
{
- struct fingerprint* fingerprint;
+ struct fingerprint *fingerprint, *tmp;
- STAILQ_FOREACH(fingerprint, list, next) {
+ STAILQ_FOREACH_SAFE(fingerprint, list, next, tmp) {
if (fingerprint->name)
free(fingerprint->name);
free(fingerprint);
OpenPOWER on IntegriCloud