mirror of
https://github.com/postgres/postgres.git
synced 2026-02-11 23:03:25 -05:00
Fix some memory leaks.
This commit is contained in:
parent
ebffbb42ac
commit
08bf4d68de
2 changed files with 8 additions and 0 deletions
|
|
@ -425,6 +425,7 @@ char rv = 1;
|
|||
if (conns[lf] && conns[lf]->henv == self)
|
||||
rv = rv && CC_Destructor(conns[lf]);
|
||||
}
|
||||
free(self);
|
||||
|
||||
mylog("exit EN_Destructor: rv = %d\n", rv);
|
||||
return rv;
|
||||
|
|
|
|||
|
|
@ -58,11 +58,18 @@ SocketClass *rv;
|
|||
|
||||
rv->buffer_in = (unsigned char *) malloc(globals.socket_buffersize);
|
||||
if ( ! rv->buffer_in)
|
||||
{
|
||||
free(rv);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rv->buffer_out = (unsigned char *) malloc(globals.socket_buffersize);
|
||||
if ( ! rv->buffer_out)
|
||||
{
|
||||
free(rv->buffer_in);
|
||||
free(rv);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
rv->errormsg = NULL;
|
||||
rv->errornumber = 0;
|
||||
|
|
|
|||
Loading…
Reference in a new issue