Skip to content

Commit

Permalink
Fix uninitialized memory and minor leaks
Browse files Browse the repository at this point in the history
  • Loading branch information
cardigliano committed Sep 4, 2024
1 parent 4e307da commit 16ef5c4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion userland/examples_ft/ftflow.c
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ void processFlow(pfring_ft_flow *flow, void *user){

void process_packet(const struct pfring_pkthdr *h, const u_char *p, const u_char *user_bytes) {
pfring_ft_pcap_pkthdr *hdr = (pfring_ft_pcap_pkthdr *) h;
pfring_ft_ext_pkthdr ext_hdr;
pfring_ft_ext_pkthdr ext_hdr = { 0 };
u_int64_t ts;
pfring_ft_action action;

Expand Down Expand Up @@ -656,5 +656,10 @@ int main(int argc, char* argv[]) {

pfring_ft_destroy_table(ft);

if (categories_file) { free(categories_file); categories_file = NULL; }
if (configuration_file) { free(configuration_file); configuration_file = NULL; }
if (device) { free(device); device = NULL; }
if (protocols_file) { free(protocols_file); protocols_file = NULL; }

return 0;
}

0 comments on commit 16ef5c4

Please sign in to comment.