Permalink
Browse files

Merge r257945 from head:

  Do not use just freed memory.

Approved by:	re (kib)
  • Loading branch information...
1 parent bb10853 commit 0daddca6bd6e186a4f552d882e66a77e988b9dd1 @glebius glebius committed Nov 14, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 usr.sbin/pkg/pkg.c
View
4 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);

0 comments on commit 0daddca

Please sign in to comment.