summaryrefslogtreecommitdiffstats
path: root/template.c
diff options
context:
space:
mode:
authorRainer Gerhards <rgerhards@adiscon.com>2012-09-17 09:28:14 +0200
committerRainer Gerhards <rgerhards@adiscon.com>2012-09-17 09:28:14 +0200
commit1aa39821f35d0e0fa7a3a621ebd5dc405ff844f1 (patch)
tree97103f1290c4d0c38a8d62f0a74f71bd1e9fef8e /template.c
parent172d35532c94576aad2a6e97b8bee3bc36aa3b57 (diff)
parent76300a1342936161d1c82ab39e98193dcc00307d (diff)
downloadrsyslog-1aa39821f35d0e0fa7a3a621ebd5dc405ff844f1.tar.gz
rsyslog-1aa39821f35d0e0fa7a3a621ebd5dc405ff844f1.tar.bz2
rsyslog-1aa39821f35d0e0fa7a3a621ebd5dc405ff844f1.zip
Merge branch 'v6-devel'
Conflicts: template.c
Diffstat (limited to 'template.c')
-rw-r--r--template.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/template.c b/template.c
index 3cef586c..15d376a3 100644
--- a/template.c
+++ b/template.c
@@ -1256,7 +1256,7 @@ createConstantTpe(struct template *pTpl, struct cnfobj *o)
struct templateEntry *pTpe;
es_str_t *value;
int i;
- struct cnfparamvals *pvals;
+ struct cnfparamvals *pvals = NULL;
uchar *outname = NULL;
DEFiRet;
@@ -1290,6 +1290,8 @@ createConstantTpe(struct template *pTpl, struct cnfobj *o)
pTpe->data.constant.pConstant = (uchar*)es_str2cstr(value, NULL);
finalize_it:
+ if(pvals != NULL)
+ cnfparamvalsDestruct(pvals, &pblkConstant);
RETiRet;
}
@@ -1310,7 +1312,7 @@ createPropertyTpe(struct template *pTpl, struct cnfobj *o)
int re_matchToUse = 0;
int re_submatchToUse = 0;
char *re_expr = NULL;
- struct cnfparamvals *pvals;
+ struct cnfparamvals *pvals = NULL;
enum {F_NONE, F_CSV, F_JSON, F_JSONF} formatType = F_NONE;
enum {CC_NONE, CC_ESCAPE, CC_SPACE, CC_DROP} controlchr = CC_NONE;
enum {SP_NONE, SP_DROP, SP_REPLACE} secpath = SP_NONE;
@@ -1328,12 +1330,10 @@ createPropertyTpe(struct template *pTpl, struct cnfobj *o)
if(!pvals[i].bUsed)
continue;
if(!strcmp(pblkProperty.descr[i].name, "name")) {
- char *tmp;
-
- tmp = es_str2cstr(pvals[i].val.d.estr, NULL);
- rsCStrConstructFromszStr(&name, (uchar*)tmp);
+ uchar *tmpstr = (uchar*)es_str2cstr(pvals[i].val.d.estr, NULL);
+ rsCStrConstructFromszStr(&name, tmpstr);
cstrFinalize(name);
- free(tmp);
+ free(tmpstr);
} else if(!strcmp(pblkProperty.descr[i].name, "droplastlf")) {
droplastlf = pvals[i].val.d.n;
} else if(!strcmp(pblkProperty.descr[i].name, "mandatory")) {
@@ -1622,7 +1622,7 @@ rsRetVal
tplProcessCnf(struct cnfobj *o)
{
struct template *pTpl = NULL;
- struct cnfparamvals *pvals;
+ struct cnfparamvals *pvals = NULL;
int lenName;
char *name = NULL;
uchar *tplStr = NULL;