From owner-freebsd-current@FreeBSD.ORG Thu Jul 1 18:52:32 2010 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D2B921065679 for ; Thu, 1 Jul 2010 18:52:32 +0000 (UTC) (envelope-from lists@yamagi.org) Received: from mail.yamagi.org (yamagi.org [88.198.78.242]) by mx1.freebsd.org (Postfix) with ESMTP id 9449E8FC13 for ; Thu, 1 Jul 2010 18:52:32 +0000 (UTC) Received: from [192.168.1.150] (f054132006.adsl.alicedsl.de [78.54.132.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.yamagi.org (Postfix) with ESMTP id 7B5F31083BAB; Thu, 1 Jul 2010 20:52:31 +0200 (CEST) Date: Thu, 1 Jul 2010 20:52:30 +0200 (CEST) From: Yamagi Burmeister X-X-Sender: yamagi@maka.home.yamagi.org To: freebsd-current@freebsd.org Message-ID: User-Agent: Alpine 2.00 (BSF 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII Cc: Christoph Mallon , jkim@freebsd.org Subject: 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: Thu, 01 Jul 2010 18:52:32 -0000 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); -- Homepage: www.yamagi.org Jabber: yamagi@yamagi.org GnuPG/GPG: 0xEFBCCBCB