Author: gschneider
Date: Thu Dec 4 10:46:54 2008
New Revision: 37853
URL:
http://svn.reactos.org/svn/reactos?rev=37853&view=rev
Log:
Free allocated resource on error, CID 1358.
Modified:
trunk/reactos/lib/sdk/crt/stdio/file.c
Modified: trunk/reactos/lib/sdk/crt/stdio/file.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/stdio/file.c?r…
==============================================================================
--- trunk/reactos/lib/sdk/crt/stdio/file.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/stdio/file.c [iso-8859-1] Thu Dec 4 10:46:54 2008
@@ -1095,7 +1095,11 @@
if (modea &&
WideCharToMultiByte(CP_ACP,0,mode,mlen,modea,mlen,NULL,NULL))
{
- if (get_flags(modea, &open_flags, &stream_flags) == -1) return NULL;
+ if (get_flags(modea, &open_flags, &stream_flags) == -1)
+ {
+ free(modea);
+ return NULL;
+ }
LOCK_FILES();
if (!(file = alloc_fp()))
file = NULL;