[ros-diffs] [arty] 36480: Fix leaks reported by coverity 612-615. In each case, it'd be safe to free NULL, and failure to allocate isn't the only dropthrough case, leading to conversion buffer leaks.
arty at svn.reactos.org
arty at svn.reactos.org
Wed Sep 24 15:35:38 CEST 2008
Author: arty
Date: Wed Sep 24 08:35:37 2008
New Revision: 36480
URL: http://svn.reactos.org/svn/reactos?rev=36480&view=rev
Log:
Fix leaks reported by coverity 612-615. In each case, it'd be safe to free
NULL, and failure to allocate isn't the only dropthrough case, leading to
conversion buffer leaks.
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?rev=36480&r1=36479&r2=36480&view=diff
==============================================================================
--- trunk/reactos/lib/sdk/crt/stdio/file.c [iso-8859-1] (original)
+++ trunk/reactos/lib/sdk/crt/stdio/file.c [iso-8859-1] Wed Sep 24 08:35:37 2008
@@ -1112,6 +1112,7 @@
}
UNLOCK_FILES();
}
+ free(modea);
return file;
}
@@ -1571,8 +1572,8 @@
free(patha);
return retval;
}
-
__set_errno(GetLastError());
+ free(patha);
return -1;
}
@@ -2561,7 +2562,8 @@
free(modea);
return retval;
}
-
+ free(patha);
+ free(modea);
__set_errno(GetLastError());
return NULL;
}
More information about the Ros-diffs
mailing list