summaryrefslogtreecommitdiffstats
path: root/cfsysline.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2007-12-20 11:32:01 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2007-12-20 11:32:01 +0000
commitb9cd4dd8bb90822d35aa5cafb3c94f689faa5009 (patch)
treed92a9c438ddbf32ddf922bda00a11743768b5ea5 /cfsysline.c
parentc34e69f9e36890af917f2cb9cdba01a8fa18d926 (diff)
downloadrsyslog-b9cd4dd8bb90822d35aa5cafb3c94f689faa5009.tar.gz
rsyslog-b9cd4dd8bb90822d35aa5cafb3c94f689faa5009.tar.xz
rsyslog-b9cd4dd8bb90822d35aa5cafb3c94f689faa5009.zip
previous patch was incorrect
Diffstat (limited to 'cfsysline.c')
-rw-r--r--cfsysline.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/cfsysline.c b/cfsysline.c
index 9cdba073..ff44af68 100644
--- a/cfsysline.c
+++ b/cfsysline.c
@@ -357,7 +357,8 @@ finalize_it:
* non-NULL pointer. If so, we assume it was created by a previous
* incarnation and is automatically freed. This happens only when
* no custom handler is defined. If it is, the customer handler
- * must do the cleanup. -- rgerhards, 2007-12-20
+ * must do the cleanup. I have checked and this was al also memory
+ * leak with some code. Obviously, not a large one. -- rgerhards, 2007-12-20
*/
static rsRetVal doGetWord(uchar **pp, rsRetVal (*pSetHdlr)(void*, uchar*), void *pVal)
{
@@ -386,8 +387,8 @@ static rsRetVal doGetWord(uchar **pp, rsRetVal (*pSetHdlr)(void*, uchar*), void
/* we got the word, now set it */
if(pSetHdlr == NULL) {
/* we should set value directly to var */
- if(pVal != NULL)
- free(pVal); /* free previous entry */
+ if(*((uchar**)pVal) != NULL)
+ free(*((uchar**)pVal)); /* free previous entry */
*((uchar**)pVal) = pNewVal; /* set new one */
} else {
/* we set value via a set function */