From owner-freebsd-bugs@FreeBSD.ORG Mon Dec 21 12:30:07 2009 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 D5CD31065676 for ; Mon, 21 Dec 2009 12:30: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 9A4458FC17 for ; Mon, 21 Dec 2009 12:30: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 nBLCU7B8082470 for ; Mon, 21 Dec 2009 12:30:07 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id nBLCU7Mm082465; Mon, 21 Dec 2009 12:30:07 GMT (envelope-from gnats) Resent-Date: Mon, 21 Dec 2009 12:30:07 GMT Resent-Message-Id: <200912211230.nBLCU7Mm082465@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 F07941065679 for ; Mon, 21 Dec 2009 12:29:33 +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 E08678FC0A for ; Mon, 21 Dec 2009 12:29:33 +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 nBLCTXhW016477 for ; Mon, 21 Dec 2009 12:29:33 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id nBLCTXQt016476; Mon, 21 Dec 2009 12:29:33 GMT (envelope-from nobody) Message-Id: <200912211229.nBLCTXQt016476@www.freebsd.org> Date: Mon, 21 Dec 2009 12:29:33 GMT From: Henning Petersen To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: bin/141836: Memory leak in usr.bin/finger/finger.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: Mon, 21 Dec 2009 12:30:07 -0000 >Number: 141836 >Category: bin >Synopsis: Memory leak in usr.bin/finger/finger.c >Confidential: no >Severity: serious >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Dec 21 12:30:07 UTC 2009 >Closed-Date: >Last-Modified: >Originator: Henning Petersen >Release: Freebsd-current >Organization: >Environment: >Description: Memory leak found with cppcheck. >How-To-Repeat: >Fix: diff -u -r1.38 finger.c --- src/usr.bin/finger/finger.c 11 Apr 2007 20:32:09 -0000 1.38 +++ src/usr.bin/finger/finger.c 21 Dec 2009 09:54:37 -0000 @@ -373,6 +373,7 @@ printf("\n"); } + free(used); if (entries == 0) return; Patch attached with submission follows: Index: src/usr.bin/finger/finger.c =================================================================== RCS file: /usr/ncvs/src/usr.bin/finger/finger.c,v retrieving revision 1.38 diff -u -r1.38 finger.c --- src/usr.bin/finger/finger.c 11 Apr 2007 20:32:09 -0000 1.38 +++ src/usr.bin/finger/finger.c 21 Dec 2009 09:54:37 -0000 @@ -373,6 +373,7 @@ printf("\n"); } + free(used); if (entries == 0) return; >Release-Note: >Audit-Trail: >Unformatted: