Author: glebius
Date: Mon Nov 11 07:44:09 2013
New Revision: 257945
URL: http://svnweb.freebsd.org/changeset/base/257945

Log:
  Do not use just freed memory.
  
  Sponsored by: Nginx, Inc.

Modified:
  head/usr.sbin/pkg/pkg.c

Modified: head/usr.sbin/pkg/pkg.c
==============================================================================
--- head/usr.sbin/pkg/pkg.c     Mon Nov 11 06:22:29 2013        (r257944)
+++ head/usr.sbin/pkg/pkg.c     Mon Nov 11 07:44:09 2013        (r257945)
@@ -323,9 +323,9 @@ parse_fingerprint(yaml_document_t *doc, 
 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);
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to