mirror of
https://github.com/reactos/reactos.git
synced 2025-04-25 16:10:29 +00:00
Martin Ettl <ettl DOT martin AT gmx DOT de>: Fix various resource and memory leaks
See issue #4974 for more details. svn path=/trunk/; revision=44364
This commit is contained in:
parent
0c2fe0a124
commit
93d086d81a
4 changed files with 7 additions and 1 deletions
|
@ -24,7 +24,7 @@ public:
|
|||
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;}
|
||||
|
|
|
@ -180,6 +180,7 @@ printercache_load_blob(char *printer_name, uint8 ** data)
|
|||
if (fstat(fd, &st))
|
||||
{
|
||||
xfree(path);
|
||||
close(fd);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -1405,7 +1405,10 @@ load_licence(RDPCLIENT * This, unsigned char **data)
|
|||
return -1;
|
||||
|
||||
if (fstat(fd, &st))
|
||||
{
|
||||
close(fd);
|
||||
return -1;
|
||||
}
|
||||
|
||||
*data = (uint8 *) xmalloc(st.st_size);
|
||||
length = read(fd, *data, st.st_size);
|
||||
|
|
|
@ -1475,6 +1475,8 @@ int load_licence(uint8 ** data)
|
|||
}
|
||||
if (fstat(fd, &st))
|
||||
{
|
||||
close(fd);
|
||||
xfree(path);
|
||||
return -1;
|
||||
}
|
||||
*data = (uint8 *) xmalloc(st.st_size);
|
||||
|
|
Loading…
Reference in a new issue