summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2009-04-09 12:28:08 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2009-04-09 12:28:08 +0200
commit5e4fc93dd523f209f78cef8a231e24975910e5ca (patch)
tree25cb7015df909725df497e33bda2633cb4fc5b42
parent01adeab0cba21ad6193addf1a4e90689b507d092 (diff)
parenta08ac7546fb3ff97e7cb7a8d5212eba159c112ec (diff)
downloadrsyslog-5e4fc93dd523f209f78cef8a231e24975910e5ca.tar.gz
rsyslog-5e4fc93dd523f209f78cef8a231e24975910e5ca.tar.xz
rsyslog-5e4fc93dd523f209f78cef8a231e24975910e5ca.zip
Merge branch 'v2-stable' into v3-stable
-rw-r--r--ChangeLog3
-rw-r--r--runtime/msg.c2
2 files changed, 5 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index a4eb6151..8726be28 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -934,6 +934,9 @@ Version 2.0.7 V2-STABLE (rgerhards), 2008-??-??
The actual code change is heavily based on William's patch.
- bugfix: memory leak in ompgsql
Thanks to Ken for providing the patch
+- bugfix: potential memory leak in msg.c
+ This one did not surface yet and the issue was actually found due to
+ a problem in v4 - but better fix it here, too
---------------------------------------------------------------------------
Version 2.0.6 V2-STABLE (rgerhards), 2008-08-07
- bugfix: memory leaks in rsyslogd, primarily in singlethread mode
diff --git a/runtime/msg.c b/runtime/msg.c
index d02b0a04..cb3e77e9 100644
--- a/runtime/msg.c
+++ b/runtime/msg.c
@@ -1440,6 +1440,8 @@ void MsgAssignHOSTNAME(msg_t *pMsg, char *pBuf)
{
assert(pMsg != NULL);
assert(pBuf != NULL);
+ if(pMsg->pszHOSTNAME != NULL)
+ free(pMsg->pszHOSTNAME);
pMsg->iLenHOSTNAME = strlen(pBuf);
pMsg->pszHOSTNAME = (uchar*) pBuf;
}