From ca503961865ad1864fda4fe42a441021940b6c21 Mon Sep 17 00:00:00 2001 From: William Robinet Date: Wed, 13 May 2015 09:45:11 +0200 Subject: [PATCH] Make valgrind/memcheck happy --- base/pcap-snoop.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/base/pcap-snoop.c b/base/pcap-snoop.c index b1bc826..e0c9b62 100644 --- a/base/pcap-snoop.c +++ b/base/pcap-snoop.c @@ -427,6 +427,7 @@ int main(argc,argv) } sprintf(tmp_filter,fmt,filter,filter); + free(filter); filter = tmp_filter; } @@ -451,6 +452,22 @@ int main(argc,argv) printf("\n.ps\n.fi\n"); printf("Cleaning %d remaining connection(s) from connection pool\n", destroy_all_conn()); + + pcap_close(p); + + free(n); + + if(filter) + free(filter); + if(file) + free(file); + if(interface_name) + free(interface_name); + if(SSL_keyfile) + free(SSL_keyfile); + if(SSL_password) + free(SSL_password); + exit(0); }