diff options
author | Michael Biebl <biebl@debian.org> | 2013-07-06 00:13:29 +0200 |
---|---|---|
committer | Michael Biebl <biebl@debian.org> | 2013-07-06 00:13:29 +0200 |
commit | f5638ea86a8626b7e0e471d720359cb4e3d8cb1c (patch) | |
tree | fd1fffc1917bd10431c829e0a439c2a522ffda6d /grammar | |
parent | c62e2e3b0f562a4ce54f7edcbb76400d90118717 (diff) | |
download | rsyslog-f5638ea86a8626b7e0e471d720359cb4e3d8cb1c.tar.gz |
Imported Upstream version 7.4.2upstream/7.4.2
Diffstat (limited to 'grammar')
-rw-r--r-- | grammar/rainerscript.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c index 89cf946..95972fb 100644 --- a/grammar/rainerscript.c +++ b/grammar/rainerscript.c @@ -938,8 +938,14 @@ nvlstGetParams(struct nvlst *lst, struct cnfparamblk *params, for(i = 0 ; i < params->nParams ; ++i) { param = params->descr + i; - if((valnode = nvlstFindNameCStr(lst, param->name)) == NULL) + if((valnode = nvlstFindNameCStr(lst, param->name)) == NULL) { + if(param->flags & CNFPARAM_REQUIRED) { + parser_errmsg("parameter '%s' required but not specified - " + "fix config", param->name); + bInError = 1; + } continue; + } if(vals[i].bUsed) { parser_errmsg("parameter '%s' specified more than once - " "one instance is ignored. Fix config", param->name); @@ -950,7 +956,6 @@ nvlstGetParams(struct nvlst *lst, struct cnfparamblk *params, } } - if(bInError) { if(bValsWasNULL) cnfparamvalsDestruct(vals, params); @@ -3444,6 +3449,8 @@ void cnfparamvalsDestruct(struct cnfparamvals *paramvals, struct cnfparamblk *blk) { int i; + if(paramvals == NULL) + return; for(i = 0 ; i < blk->nParams ; ++i) { if(paramvals[i].bUsed) { varDelete(¶mvals[i].val); |