From owner-svn-src-all@FreeBSD.ORG Mon Nov 11 07:44:10 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 81DDB887; Mon, 11 Nov 2013 07:44:10 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 6E40E20D7; Mon, 11 Nov 2013 07:44:10 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAB7iADu041491; Mon, 11 Nov 2013 07:44:10 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAB7iA6g041490; Mon, 11 Nov 2013 07:44:10 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201311110744.rAB7iA6g041490@svn.freebsd.org> From: Gleb Smirnoff Date: Mon, 11 Nov 2013 07:44:10 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r257945 - head/usr.sbin/pkg X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Nov 2013 07:44:10 -0000 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);