Skip to content

Commit

Permalink
Fix 3 large memory leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
rpedde committed Oct 29, 2007
1 parent e842f38 commit f3d1caf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/ff-plugins.c
Expand Up @@ -291,6 +291,8 @@ EXPORT void pi_db_enum_dispose(char **pe, DB_QUERY *pinfo) {
sp_dispose(pqi->pt); sp_dispose(pqi->pt);
pqi->pt = NULL; pqi->pt = NULL;
} }
free(pqi);
pinfo->priv = NULL;
} }
} }


Expand Down
7 changes: 6 additions & 1 deletion src/io.c
Expand Up @@ -1088,9 +1088,11 @@ int io_printf(IO_PRIVHANDLE *phandle, char *fmt, ...) {


len = new_size; len = new_size;
if(!io_write(phandle,(unsigned char *)outbuf,&len) || (len != new_size)) { if(!io_write(phandle,(unsigned char *)outbuf,&len) || (len != new_size)) {
free(outbuf);
return FALSE; return FALSE;
} }


free(outbuf);
return TRUE; return TRUE;
} }


Expand Down Expand Up @@ -2221,6 +2223,9 @@ int io_socket_close(IO_PRIVHANDLE *phandle) {
} }
#endif #endif


free(priv);
phandle->private = NULL;

return TRUE; return TRUE;
} }


Expand Down Expand Up @@ -2314,7 +2319,7 @@ int io_socket_write(IO_PRIVHANDLE *phandle, unsigned char *buf,uint32_t *len) {
#ifdef WIN32 #ifdef WIN32
if(WSAGetLastError() == WSAEWOULDBLOCK) { if(WSAGetLastError() == WSAEWOULDBLOCK) {
byteswritten = 0; byteswritten = 0;

if(priv->hEvent) { if(priv->hEvent) {
WSAEventSelect(priv->fd,(WSAEVENT)priv->hEvent,0); WSAEventSelect(priv->fd,(WSAEVENT)priv->hEvent,0);
} }
Expand Down

0 comments on commit f3d1caf

Please sign in to comment.