bin/69275: [PATCH] tftp memory leak fix

Maxim Konovalov maxim at FreeBSD.org
Mon Jul 19 08:30:18 PDT 2004


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

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


More information about the freebsd-bugs mailing list