From owner-freebsd-bugs@FreeBSD.ORG Tue Jan 5 08:00:07 2010 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 376C41065692 for ; Tue, 5 Jan 2010 08:00:07 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 0DBA38FC20 for ; Tue, 5 Jan 2010 08:00:07 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id o05806Qs002392 for ; Tue, 5 Jan 2010 08:00:06 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id o05806MS002391; Tue, 5 Jan 2010 08:00:06 GMT (envelope-from gnats) Resent-Date: Tue, 5 Jan 2010 08:00:06 GMT Resent-Message-Id: <201001050800.o05806MS002391@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Henning Petersen Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F26241065679 for ; Tue, 5 Jan 2010 07:57:44 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id E238B8FC14 for ; Tue, 5 Jan 2010 07:57:44 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o057viqd018866 for ; Tue, 5 Jan 2010 07:57:44 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o057vinm018865; Tue, 5 Jan 2010 07:57:44 GMT (envelope-from nobody) Message-Id: <201001050757.o057vinm018865@www.freebsd.org> Date: Tue, 5 Jan 2010 07:57:44 GMT From: Henning Petersen To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: misc/142339: Double free in getnetpath.c. X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 05 Jan 2010 08:00:07 -0000 >Number: 142339 >Category: misc >Synopsis: Double free in getnetpath.c. >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Tue Jan 05 08:00:06 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Henning Petersen >Release: Freebsd-current >Organization: >Environment: >Description: np_sessionp is freed at line 102 and line 123. >How-To-Repeat: >Fix: diff -u -r1.8 getnetpath.c --- lib/libc/rpc/getnetpath.c 20 Sep 2007 22:35:24 -0000 1.8 +++ lib/libc/rpc/getnetpath.c 5 Jan 2010 05:52:21 -0000 @@ -101,7 +101,7 @@ if ((np_sessionp->nc_handlep = setnetconfig()) == NULL) { free(np_sessionp); syslog (LOG_ERR, "rpc: failed to open " NETCONFIG); - goto failed; + return (NULL); } np_sessionp->valid = NP_VALID; np_sessionp->ncp_list = NULL; Patch attached with submission follows: Index: lib/libc/rpc/getnetpath.c =================================================================== RCS file: /usr/ncvs/src/lib/libc/rpc/getnetpath.c,v retrieving revision 1.8 diff -u -r1.8 getnetpath.c --- lib/libc/rpc/getnetpath.c 20 Sep 2007 22:35:24 -0000 1.8 +++ lib/libc/rpc/getnetpath.c 5 Jan 2010 05:52:21 -0000 @@ -101,7 +101,7 @@ if ((np_sessionp->nc_handlep = setnetconfig()) == NULL) { free(np_sessionp); syslog (LOG_ERR, "rpc: failed to open " NETCONFIG); - goto failed; + return (NULL); } np_sessionp->valid = NP_VALID; np_sessionp->ncp_list = NULL; >Release-Note: >Audit-Trail: >Unformatted: