From owner-svn-src-stable@FreeBSD.ORG Thu Nov 14 09:26:52 2013 Return-Path: Delivered-To: svn-src-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E083BA4; Thu, 14 Nov 2013 09:26:52 +0000 (UTC) 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 D035629F6; Thu, 14 Nov 2013 09:26:52 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rAE9QqbZ044028; Thu, 14 Nov 2013 09:26:52 GMT (envelope-from glebius@svn.freebsd.org) Received: (from glebius@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id rAE9QqV0044027; Thu, 14 Nov 2013 09:26:52 GMT (envelope-from glebius@svn.freebsd.org) Message-Id: <201311140926.rAE9QqV0044027@svn.freebsd.org> From: Gleb Smirnoff Date: Thu, 14 Nov 2013 09:26:52 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r258126 - stable/10/usr.sbin/pkg X-SVN-Group: stable-10 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Nov 2013 09:26:53 -0000 Author: glebius Date: Thu Nov 14 09:26:52 2013 New Revision: 258126 URL: http://svnweb.freebsd.org/changeset/base/258126 Log: Merge r257945 from head: Do not use just freed memory. Approved by: re (kib) Modified: stable/10/usr.sbin/pkg/pkg.c Directory Properties: stable/10/usr.sbin/pkg/ (props changed) Modified: stable/10/usr.sbin/pkg/pkg.c ============================================================================== --- stable/10/usr.sbin/pkg/pkg.c Thu Nov 14 09:25:29 2013 (r258125) +++ stable/10/usr.sbin/pkg/pkg.c Thu Nov 14 09:26:52 2013 (r258126) @@ -326,9 +326,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);