From owner-freebsd-current@FreeBSD.ORG Tue Jul 6 18:11:35 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 1E7BE1065672; Tue, 6 Jul 2010 18:11:35 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Yamagi Burmeister Date: Tue, 6 Jul 2010 14:11:19 -0400 User-Agent: KMail/1.6.2 References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201007061411.20799.jkim@FreeBSD.org> Cc: Christoph Mallon , freebsd-current@freebsd.org Subject: Re: PATCH: Potential ressource leak in sys/dev/fb/vesa.c X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 06 Jul 2010 18:11:35 -0000 On Thursday 01 July 2010 02:52 pm, Yamagi Burmeister wrote: > Hello, > while tracking down a bug in vesa.c which caused a crash a friend > of mine noticed a potential ressource leak in vesa.c. In line 841 > the execution is aborted via return (1); without freeing the > already allocated resources. the attached patch changes the line to > "goto fail;" which seems more correct. > > --- a/sys/dev/fb/vesa.c > +++ b/sys/dev/fb/vesa.c > @@ -836,7 +836,7 @@ vesa_bios_init(void) > "version 1.2 or later is required.\n", > ((vers & 0xf000) >> 12) * 10 + ((vers & 0x0f00) >> 8), > ((vers & 0x00f0) >> 4) * 10 + (vers & 0x000f)); > - return (1); > + goto fail; > } > > VESA_STRCPY(vesa_oemstr, buf->v_oemstr); Fixed on HEAD. Will be MFC'ed soon. Thanks! Jung-uk Kim