From owner-freebsd-bugs@FreeBSD.ORG Mon Jul 19 15:30:18 2004 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0E85616A4CE for ; Mon, 19 Jul 2004 15:30:18 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0623F43D39 for ; Mon, 19 Jul 2004 15:30:18 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.11/8.12.11) with ESMTP id i6JFUHkT072726 for ; Mon, 19 Jul 2004 15:30:17 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.11/8.12.11/Submit) id i6JFUHdK072725; Mon, 19 Jul 2004 15:30:17 GMT (envelope-from gnats) Date: Mon, 19 Jul 2004 15:30:17 GMT Message-Id: <200407191530.i6JFUHdK072725@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Maxim Konovalov Subject: Re: bin/69275: [PATCH] tftp memory leak fix X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Maxim Konovalov List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jul 2004 15:30:18 -0000 The following reply was made to PR bin/69275; it has been noted by GNATS. From: Maxim Konovalov To: "Liam J. Foy" Cc: bug-followup@FreeBSD.org Subject: Re: bin/69275: [PATCH] tftp memory leak fix Date: Mon, 19 Jul 2004 19:29:40 +0400 (MSD) On Mon, 19 Jul 2004, 12:03+0100, Liam J. Foy wrote: > > >Number: 69275 > >Category: bin > >Synopsis: [PATCH] tftp memory leak fix [...] > >Originator: Liam J. Foy > >Release: FreeBSD 5.2-RELEASE i386 > The following patch contains a fix for a memory leak within tftp. > This was first noticed on the OpenBSD camp. > >Fix: > > > --- /FreeBSD/FreeBSD-current/src/usr.bin/tftp/main.c 2003-10-11 17:27:55.000000000 -0700 > +++ main.c 2004-07-19 03:59:11.000000000 -0700 > @@ -495,6 +495,7 @@ > fd = creat(cp, 0644); > if (fd < 0) { > warn("%s", cp); > + free(cp); > continue; > } > if (verbose) Are you sure this patch is applicable to FreeBSD? OpenBSD uses asprintf(3) in put() that is why they need free(cp) if they fail to open(2) but FreeBSD doesn't. Moreover, your patch is for get(). Could you please elaborate? -- Maxim Konovalov