summaryrefslogtreecommitdiffstats
path: root/obj.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2008-04-03 13:55:44 +0000
committerRainer Gerhards <rgerhards@adiscon.com>2008-04-03 13:55:44 +0000
commit8b8c1f095a8d822a0bde4993e233038567665d90 (patch)
tree0549de17d94729f35dbae7c5442a7160f66ce022 /obj.c
parent46fbfee41e88034135725beb4136d44b94388ede (diff)
downloadrsyslog-8b8c1f095a8d822a0bde4993e233038567665d90.tar.gz
rsyslog-8b8c1f095a8d822a0bde4993e233038567665d90.tar.xz
rsyslog-8b8c1f095a8d822a0bde4993e233038567665d90.zip
bugfix: some memory leak when queue is runing in disk mode
Diffstat (limited to 'obj.c')
-rw-r--r--obj.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/obj.c b/obj.c
index 0baaf7a1..d408c4bb 100644
--- a/obj.c
+++ b/obj.c
@@ -731,7 +731,7 @@ finalize_it:
static rsRetVal objDeserializeProperties(obj_t *pObj, objInfo_t *pObjInfo, strm_t *pStrm)
{
DEFiRet;
- var_t *pVar;
+ var_t *pVar = NULL;
ISOBJ_assert(pObj);
ISOBJ_TYPE_assert(pStrm, strm);
@@ -743,15 +743,23 @@ static rsRetVal objDeserializeProperties(obj_t *pObj, objInfo_t *pObjInfo, strm_
iRet = objDeserializeProperty(pVar, pStrm);
while(iRet == RS_RET_OK) {
CHKiRet(pObjInfo->objMethods[objMethod_SETPROPERTY](pObj, pVar));
+ /* re-init var object - TODO: method of var! */
+ rsCStrDestruct(&pVar->pcsName); /* no longer needed */
+ if(pVar->varType == VARTYPE_STR) {
+ if(pVar->val.pStr != NULL)
+ rsCStrDestruct(&pVar->val.pStr);
+ }
iRet = objDeserializeProperty(pVar, pStrm);
}
- var.Destruct(&pVar);
if(iRet != RS_RET_NO_PROPLINE)
FINALIZE;
CHKiRet(objDeserializeTrailer(pStrm)); /* do trailer checks */
finalize_it:
+ if(pVar != NULL)
+ var.Destruct(&pVar);
+
RETiRet;
}