From 08bf4d68de934c3e5db5b926fbfb8dfd1669281f Mon Sep 17 00:00:00 2001 From: Hiroshi Inoue Date: Wed, 14 Mar 2001 09:10:04 +0000 Subject: [PATCH] Fix some memory leaks. --- src/interfaces/odbc/environ.c | 1 + src/interfaces/odbc/socket.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/interfaces/odbc/environ.c b/src/interfaces/odbc/environ.c index 6099ba4d10..fb8ed6869a 100644 --- a/src/interfaces/odbc/environ.c +++ b/src/interfaces/odbc/environ.c @@ -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; diff --git a/src/interfaces/odbc/socket.c b/src/interfaces/odbc/socket.c index 6b551792fe..555f9bff4c 100644 --- a/src/interfaces/odbc/socket.c +++ b/src/interfaces/odbc/socket.c @@ -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; -- 2.40.0