summaryrefslogtreecommitdiffstats
path: root/action.c
diff options
context:
space:
mode:
Diffstat (limited to 'action.c')
-rw-r--r--action.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/action.c b/action.c
index d1dcad89..9c780fb6 100644
--- a/action.c
+++ b/action.c
@@ -823,9 +823,13 @@ static rsRetVal prepareDoActionParams(action_t *pAction, batch_obj_t *pElem)
case ACT_MSG_PASSING:
pElem->staticActParams[i] = (void*) pMsg;
break;
- case ACT_FIELDS_PASSING:
- pElem->staticActParams[i] = "";
+ case ACT_FIELDS_PASSING: {
+ struct templateField *fields;
+
+ CHKiRet(tplToFields(pAction->ppTpl[i], pMsg, &fields));
+ pElem->staticActParams[i] = fields;
break;
+ }
default:dbgprintf("software bug/error: unknown pAction->eParamPassing %d in prepareDoActionParams\n",
(int) pAction->eParamPassing);
assert(0); /* software bug if this happens! */
@@ -877,7 +881,6 @@ static rsRetVal releaseBatch(action_t *pAction, batch_t *pBatch)
break;
case ACT_STRING_PASSING:
case ACT_MSG_PASSING:
- case ACT_FIELDS_PASSING:
/* nothing to do in that case */
/* TODO ... and yet we do something ;) This is considered not
* really needed, but I was not bold enough to remove that while
@@ -889,6 +892,21 @@ static rsRetVal releaseBatch(action_t *pAction, batch_t *pBatch)
((uchar**)pElem->staticActParams)[j] = NULL;
}
break;
+ case ACT_FIELDS_PASSING:
+ for(j = 0 ; j < pAction->iNumTpls ; ++j) {
+ struct templateField *fields;
+
+ fields = pElem->staticActParams[j];
+ if (fields!= NULL) {
+ size_t k;
+
+ for (k = 0; fields[k].fieldName != NULL; k++)
+ free(fields[k].value);
+ free(fields);
+ pElem->staticActParams[j] = NULL;
+ }
+ }
+ break;
}
}
}