Author: pschweitzer
Date: Mon Sep 19 07:29:36 2011
New Revision: 53742
URL:
http://svn.reactos.org/svn/reactos?rev=53742&view=rev
Log:
[SPEC2DEF]
Fix resources leak
Modified:
trunk/reactos/tools/spec2def/spec2def.c
Modified: trunk/reactos/tools/spec2def/spec2def.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/tools/spec2def/spec2def.c?…
==============================================================================
--- trunk/reactos/tools/spec2def/spec2def.c [iso-8859-1] (original)
+++ trunk/reactos/tools/spec2def/spec2def.c [iso-8859-1] Mon Sep 19 07:29:36 2011
@@ -807,7 +807,11 @@
/* Allocate memory buffer */
pszSource = malloc(nFileSize + 1);
- if (!pszSource) return -4;
+ if (!pszSource)
+ {
+ fclose(file);
+ return -4;
+ }
/* Load input file into memory */
nFileSize = fread(pszSource, 1, nFileSize, file);