diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-12-03 15:45:54 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-12-03 15:45:54 +0100 |
commit | 4252edfebe096c805c7884e6775332705d46472f (patch) | |
tree | 43274d01fdee8e7da6da73356adf5d100933d084 /runtime/nsd_gtls.c | |
parent | b41bdeff56ad9d54dddcb8703560c750f04a6370 (diff) | |
download | rsyslog-4252edfebe096c805c7884e6775332705d46472f.tar.gz rsyslog-4252edfebe096c805c7884e6775332705d46472f.tar.xz rsyslog-4252edfebe096c805c7884e6775332705d46472f.zip |
bugfix: memory leaks in gtls netstream driver
Diffstat (limited to 'runtime/nsd_gtls.c')
-rw-r--r-- | runtime/nsd_gtls.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/runtime/nsd_gtls.c b/runtime/nsd_gtls.c index 073d333c..3a79a015 100644 --- a/runtime/nsd_gtls.c +++ b/runtime/nsd_gtls.c @@ -1229,7 +1229,6 @@ SetAuthMode(nsd_t *pNsd, uchar *mode) /* TODO: clear stored IDs! */ finalize_it: -dbgprintf("gtls auth mode %d set\n", pThis->authMode); RETiRet; } @@ -1491,6 +1490,13 @@ Rcv(nsd_t *pNsd, uchar *pBuf, ssize_t *pLenBuf) if(pThis->lenRcvBuf == 0) { /* EOS */ *pLenBuf = 0; + /* in this case, we also need to free the receive buffer, if we + * allocated one. -- rgerhards, 2008-12-03 + */ + if(pThis->pszRcvBuf != NULL) { + free(pThis->pszRcvBuf); + pThis->pszRcvBuf = NULL; + } ABORT_FINALIZE(RS_RET_CLOSED); } |