diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2008-04-03 13:56:36 +0000 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2008-04-03 13:56:36 +0000 |
commit | 4ec54f46166c33ee96bdc9d271b4a3610d6007bd (patch) | |
tree | 19e61d4172889e28510c04766c7d3eeda8cc37a3 /obj.c | |
parent | 4419e1068aff9e88ed419f6439f577bb0960f7a0 (diff) | |
download | rsyslog-4ec54f46166c33ee96bdc9d271b4a3610d6007bd.tar.gz rsyslog-4ec54f46166c33ee96bdc9d271b4a3610d6007bd.tar.xz rsyslog-4ec54f46166c33ee96bdc9d271b4a3610d6007bd.zip |
bugfix: some memory leak when queue is runing in disk mode
Diffstat (limited to 'obj.c')
-rw-r--r-- | obj.c | 12 |
1 files changed, 10 insertions, 2 deletions
@@ -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; } |