Author: gschneider
Date: Wed Dec 2 19:28:52 2009
New Revision: 44364
URL:
http://svn.reactos.org/svn/reactos?rev=44364&view=rev
Log:
Martin Ettl <ettl DOT martin AT gmx DOT de>: Fix various resource and memory leaks
See issue #4974 for more details.
Modified:
trunk/reactos/base/applications/network/telnet/src/tnetwork.h
trunk/reactos/base/applications/tsclient/rdesktop/printercache.c
trunk/reactos/base/applications/tsclient/rdesktop/rdesktop.c
trunk/reactos/base/applications/tsclient/rdesktop/uiports/qtwin.cpp
Modified: trunk/reactos/base/applications/network/telnet/src/tnetwork.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/network/…
==============================================================================
--- trunk/reactos/base/applications/network/telnet/src/tnetwork.h [iso-8859-1] (original)
+++ trunk/reactos/base/applications/network/telnet/src/tnetwork.h [iso-8859-1] Wed Dec 2
19:28:52 2009
@@ -24,7 +24,7 @@
TNetwork(SOCKET s = 0): socket(s), local_echo(1), line_mode(1),
net_type(TN_NETSOCKET), naws_func((Naws_func_t)NULL),
local_address((char *)NULL) {}
- ~TNetwork() {if(local_address) delete local_address;}
+ ~TNetwork() {if(local_address) delete[] local_address;}
void SetSocket(SOCKET s);
SOCKET GetSocket() {return socket;}
Modified: trunk/reactos/base/applications/tsclient/rdesktop/printercache.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/tsclient…
==============================================================================
--- trunk/reactos/base/applications/tsclient/rdesktop/printercache.c [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/tsclient/rdesktop/printercache.c [iso-8859-1] Wed Dec
2 19:28:52 2009
@@ -180,6 +180,7 @@
if (fstat(fd, &st))
{
xfree(path);
+ close(fd);
return 0;
}
Modified: trunk/reactos/base/applications/tsclient/rdesktop/rdesktop.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/tsclient…
==============================================================================
--- trunk/reactos/base/applications/tsclient/rdesktop/rdesktop.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/tsclient/rdesktop/rdesktop.c [iso-8859-1] Wed Dec 2
19:28:52 2009
@@ -1405,7 +1405,10 @@
return -1;
if (fstat(fd, &st))
+ {
+ close(fd);
return -1;
+ }
*data = (uint8 *) xmalloc(st.st_size);
length = read(fd, *data, st.st_size);
Modified: trunk/reactos/base/applications/tsclient/rdesktop/uiports/qtwin.cpp
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/tsclient…
==============================================================================
--- trunk/reactos/base/applications/tsclient/rdesktop/uiports/qtwin.cpp [iso-8859-1]
(original)
+++ trunk/reactos/base/applications/tsclient/rdesktop/uiports/qtwin.cpp [iso-8859-1] Wed
Dec 2 19:28:52 2009
@@ -1475,6 +1475,8 @@
}
if (fstat(fd, &st))
{
+ close(fd);
+ xfree(path);
return -1;
}
*data = (uint8 *) xmalloc(st.st_size);