Makes the fuzz target more stateless
And manages to find bugs on the FlowFree path
#include "util-unittest-helper.h"
#include "conf-yaml-loader.h"
#include "pkt-var.h"
+#include "flow-util.h"
#include <fuzz_pcap.h>
p->pcap_cnt = pcap_cnt;
}
PacketFree(p);
+ for (uint32_t u = 0; u < flow_config.hash_size; u++) {
+ Flow *f = flow_hash[u].head;
+ while (f) {
+ Flow *n = f->next;
+ uint8_t proto_map = FlowGetProtoMapping(f->proto);
+ FlowClearMemory(f, proto_map);
+ FlowFree(f);
+ f = n;
+ }
+ flow_hash[u].head = NULL;
+ }
return 0;
}