core: potential misadressing when accessing JSON properties

When a JSON property is accessed in template processing, memory
may be misadressed or a double-free may occur while obtaining the
propety.

This was detected by a Coverty scan.
This commit is contained in:
Rainer Gerhards 2017-10-26 10:29:13 +02:00
parent 5838aa6c77
commit cdc5d6bae9

View File

@ -2998,8 +2998,6 @@ getJSONPropVal(smsg_t * const pMsg, msgPropDescr_t *pProp, uchar **pRes, rs_size
struct json_object *field; struct json_object *field;
DEFiRet; DEFiRet;
if(*pbMustBeFreed)
free(*pRes);
*pRes = NULL; *pRes = NULL;
if(pProp->id == PROP_CEE) { if(pProp->id == PROP_CEE) {