flow: fix a possible memory leak in parse_ct_state
state_s should be freed always before exit parse_ct_state
Fixes: ("conntrack: Move ct_state parsing to lib/flow.c")
Acked-by: Ilya Maximets
@@ -1299,6 +1299,7 @@ parse_ct_state(const char *state_str, uint32_t default_state,
if (!bit) {
ds_put_format(ds, "%s: unknown connection tracking state flag",
cs);
+ free(state_s);
return false;
}
state |= bit;
