diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2011-03-06 15:59:06 +0100 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2011-03-06 15:59:06 +0100 |
commit | 4d55e2481f51b59fff9a32f9392bb3e74da9789a (patch) | |
tree | 23c6cfd59a8575a16249a1303cb0ec2629ba3f5a | |
parent | 4fb7dd296efc6a798e884f0504fdf0bedebba9f5 (diff) | |
download | rsyslog-4d55e2481f51b59fff9a32f9392bb3e74da9789a.tar.gz rsyslog-4d55e2481f51b59fff9a32f9392bb3e74da9789a.tar.xz rsyslog-4d55e2481f51b59fff9a32f9392bb3e74da9789a.zip |
forgot to backport imdiag mem leak fix -- now done
-rw-r--r-- | plugins/imdiag/imdiag.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/imdiag/imdiag.c b/plugins/imdiag/imdiag.c index b7a2a070..0a69ee43 100644 --- a/plugins/imdiag/imdiag.c +++ b/plugins/imdiag/imdiag.c @@ -292,6 +292,7 @@ OnMsgReceived(tcps_sess_t *pSess, uchar *pRcv, int iLenMsg) { int iMsgQueueSize; uchar *pszMsg; + uchar *pToFree = NULL; uchar cmdBuf[1024]; DEFiRet; @@ -303,6 +304,7 @@ OnMsgReceived(tcps_sess_t *pSess, uchar *pRcv, int iLenMsg) * before proceeding. */ CHKmalloc(pszMsg = MALLOC(sizeof(uchar) * (iLenMsg + 1))); + pToFree = pszMsg; memcpy(pszMsg, pRcv, iLenMsg); pszMsg[iLenMsg] = '\0'; @@ -322,6 +324,8 @@ OnMsgReceived(tcps_sess_t *pSess, uchar *pRcv, int iLenMsg) } finalize_it: + if(pToFree != NULL) + free(pToFree); RETiRet; } |