diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2013-10-23 16:10:55 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2013-10-23 16:10:55 +0200 |
commit | cdc306767df06937c2d14b459a6963154fb6d400 (patch) | |
tree | 883c9f8e52422b1fad21e43cdef093e9a4d869e5 | |
parent | 059a3168246f803936de63ced1d356d649d4ad16 (diff) | |
download | rsyslog-cdc306767df06937c2d14b459a6963154fb6d400.tar.gz rsyslog-cdc306767df06937c2d14b459a6963154fb6d400.tar.bz2 rsyslog-cdc306767df06937c2d14b459a6963154fb6d400.zip |
fix small memleak introduced during refactoring
-rw-r--r-- | template.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -754,7 +754,7 @@ static rsRetVal do_Parameter(uchar **pp, struct template *pTpl) { uchar *p; - cstr_t *pStrProp; + cstr_t *pStrProp = NULL; cstr_t *pStrField = NULL; struct templateEntry *pTpe; int iNum; /* to compute numbers */ @@ -1099,10 +1099,11 @@ do_Parameter(uchar **pp, struct template *pTpl) DBGPRINTF("template/do_Parameter: fieldName is NULL!\n"); ABORT_FINALIZE(RS_RET_OUT_OF_MEMORY); } - cstrDestruct(&pStrProp); if(*p) ++p; /* eat '%' */ *pp = p; finalize_it: + if(pStrProp != NULL) + cstrDestruct(&pStrProp); RETiRet; } |