From owner-svn-src-head@FreeBSD.ORG Sat Dec 7 01:35:19 2013 Return-Path: Delivered-To: svn-src-head@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 6B924648; Sat, 7 Dec 2013 01:35:19 +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 58077156A; Sat, 7 Dec 2013 01:35:19 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id rB71ZJAM022507; Sat, 7 Dec 2013 01:35:19 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.7/8.14.7/Submit) id rB71ZJbu022506; Sat, 7 Dec 2013 01:35:19 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201312070135.rB71ZJbu022506@svn.freebsd.org> From: Marcel Moolenaar Date: Sat, 7 Dec 2013 01:35:19 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r259056 - head/games/fortune/fortune X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 07 Dec 2013 01:35:19 -0000 Author: marcel Date: Sat Dec 7 01:35:18 2013 New Revision: 259056 URL: http://svnweb.freebsd.org/changeset/base/259056 Log: Fix r203922 for "fortune -o": we free tpath when was_malloc is true but don't define tpath everytime we set was_malloc to true. We end up calling free() multiple times for the same pointer, resulting in: : jemalloc_arena.c:355: Failed assertion: ... When we set path to offensive, we need to set tpath as well. Modified: head/games/fortune/fortune/fortune.c Modified: head/games/fortune/fortune/fortune.c ============================================================================== --- head/games/fortune/fortune/fortune.c Sat Dec 7 00:33:10 2013 (r259055) +++ head/games/fortune/fortune/fortune.c Sat Dec 7 01:35:18 2013 (r259056) @@ -486,7 +486,7 @@ add_file(int percent, const char *file, if (Offend) { if (was_malloc) free(tpath); - path = offensive; + path = tpath = offensive; offensive = NULL; was_malloc = TRUE; DPRINTF(1, (stderr, "\ttrying \"%s\"\n", path)); @@ -508,7 +508,7 @@ over: if (All_forts && offensive != NULL) { if (was_malloc) free(tpath); - path = offensive; + path = tpath = offensive; offensive = NULL; was_malloc = TRUE; DPRINTF(1, (stderr, "\ttrying \"%s\"\n", path));