diff options
-rw-r--r-- | grammar/rainerscript.c | 3 | ||||
-rw-r--r-- | plugins/ommongodb/ommongodb.c | 4 | ||||
-rw-r--r-- | runtime/modules.c | 4 | ||||
-rw-r--r-- | runtime/ruleset.c | 3 |
4 files changed, 9 insertions, 5 deletions
diff --git a/grammar/rainerscript.c b/grammar/rainerscript.c index 2e066d78..90bbb335 100644 --- a/grammar/rainerscript.c +++ b/grammar/rainerscript.c @@ -1037,8 +1037,9 @@ evalVar(struct cnfvar *var, void *usrptr, struct var *ret) #define FREE_TWO_STRINGS \ if(bMustFree) es_deleteStr(estr_r); \ + if(expr->r->nodetype != 'S' && r.datatype == 'S') es_deleteStr(r.d.estr); \ if(bMustFree2) es_deleteStr(estr_l); \ - FREE_BOTH_RET + if(l.datatype == 'S') es_deleteStr(l.d.estr) /* evaluate an expression. * Note that we try to avoid malloc whenever possible (because of diff --git a/plugins/ommongodb/ommongodb.c b/plugins/ommongodb/ommongodb.c index c1648c50..2c65f275 100644 --- a/plugins/ommongodb/ommongodb.c +++ b/plugins/ommongodb/ommongodb.c @@ -296,7 +296,9 @@ static bson *BSONFromJSONObject(struct json_object *json); static gboolean BSONAppendJSONObject(bson *doc, const gchar *name, struct json_object *json) { - switch(json_object_get_type(json)) { + switch(json != NULL ? json_object_get_type(json) : json_type_null) { + case json_type_null: + return bson_append_null(doc, name); case json_type_boolean: return bson_append_boolean(doc, name, json_object_get_boolean(json)); diff --git a/runtime/modules.c b/runtime/modules.c index f580e58e..8675e414 100644 --- a/runtime/modules.c +++ b/runtime/modules.c @@ -313,8 +313,8 @@ finalize_it: /* get the name of a module */ -uchar -*modGetName(modInfo_t *pThis) +uchar * +modGetName(modInfo_t *pThis) { return((pThis->pszName == NULL) ? (uchar*) "" : pThis->pszName); } diff --git a/runtime/ruleset.c b/runtime/ruleset.c index adbce731..2af44bc4 100644 --- a/runtime/ruleset.c +++ b/runtime/ruleset.c @@ -48,6 +48,7 @@ #include "action.h" #include "rainerscript.h" #include "srUtils.h" +#include "modules.h" #include "dirty.h" /* for main ruleset queue creation */ /* static data */ @@ -217,7 +218,7 @@ static rsRetVal execAct(struct cnfstmt *stmt, batch_t *pBatch, sbool *active) { DEFiRet; -dbgprintf("RRRR: execAct: batch of %d elements, active %p\n", batchNumMsgs(pBatch), active); +dbgprintf("RRRR: execAct [%s]: batch of %d elements, active %p\n", modGetName(stmt->d.act->pMod), batchNumMsgs(pBatch), active); pBatch->active = active; stmt->d.act->submitToActQ(stmt->d.act, pBatch); RETiRet; |