PATCH: Potential ressource leak in sys/dev/fb/vesa.c

From: Yamagi Burmeister <lists_at_yamagi.org>
Date: Thu, 1 Jul 2010 20:52:30 +0200 (CEST)
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
_at__at_ -836,7 +836,7 _at__at_ 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_at_yamagi.org
GnuPG/GPG:    0xEFBCCBCB
Received on Thu Jul 01 2010 - 16:52:32 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:05 UTC