Actions
Bug #7466
closed
HV
JL
lua: Flowvar memory leak
Bug #7466:
lua: Flowvar memory leak
Affected Versions:
Effort:
Difficulty:
Label:
Description
In LuaSetFlowvar -> LuaSetFlowvarByKey, the key is malloced:
uint8_t *keybuf = SCMalloc(keylen+1);
// ..
FlowVarAddKeyValue(f, keybuf, (uint16_t)keylen, buffer, (uint16_t)len);
However, this is never free'd (FLOW_DESTROY / FLOW_RECYCLE -> GenericVarFree -> FlowVarFree)
void FlowVarFree(FlowVar *fv)
{
if (fv == NULL)
return;
if (fv->datatype == FLOWVAR_TYPE_STR) {
if (fv->data.fv_str.value != NULL)
SCFree(fv->data.fv_str.value);
}
SCFree(fv);
}
Leading to potential memory leaks.
Files
Actions