diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2009-04-09 12:26:56 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2009-04-09 12:26:56 +0200 |
commit | a08ac7546fb3ff97e7cb7a8d5212eba159c112ec (patch) | |
tree | c624ee04164e59f1419de91bf2da6361858a836a /msg.c | |
parent | 3c236053cf87a16dfd7449f729e477dffd6e2fae (diff) | |
download | rsyslog-a08ac7546fb3ff97e7cb7a8d5212eba159c112ec.tar.gz rsyslog-a08ac7546fb3ff97e7cb7a8d5212eba159c112ec.tar.bz2 rsyslog-a08ac7546fb3ff97e7cb7a8d5212eba159c112ec.zip |
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.
Diffstat (limited to 'msg.c')
-rw-r--r-- | msg.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -1116,6 +1116,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; } |