Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 19 Jul 2004 15:30:17 GMT
From:      Maxim Konovalov <maxim@FreeBSD.org>
To:        freebsd-bugs@FreeBSD.org
Subject:   Re: bin/69275: [PATCH] tftp memory leak fix
Message-ID:  <200407191530.i6JFUHdK072725@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

The following reply was made to PR bin/69275; it has been noted by GNATS.

From: Maxim Konovalov <maxim@FreeBSD.org>
To: "Liam J. Foy" <liamfoy@sepulcrum.org>
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200407191530.i6JFUHdK072725>