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 | |
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')
-rw-r--r-- | runtime/netstrms.c | 4 | ||||
-rw-r--r-- | runtime/nsd_gtls.c | 8 |
2 files changed, 11 insertions, 1 deletions
diff --git a/runtime/netstrms.c b/runtime/netstrms.c index 2b754ecc..6b28e7ea 100644 --- a/runtime/netstrms.c +++ b/runtime/netstrms.c @@ -104,6 +104,10 @@ CODESTARTobjDestruct(netstrms) obj.ReleaseObj(__FILE__, pThis->pDrvrName+2, pThis->pDrvrName, (void*) &pThis->Drvr); free(pThis->pDrvrName); } + if(pThis->pszDrvrAuthMode != NULL) { + free(pThis->pszDrvrAuthMode); + pThis->pszDrvrAuthMode = NULL; + } if(pThis->pBaseDrvrName != NULL) { free(pThis->pBaseDrvrName); pThis->pBaseDrvrName = NULL; 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); } |