mirror of
https://github.com/adulau/ssldump.git
synced 2024-12-22 16:05:58 +00:00
Close global pcap struct properly in case of SIGINT
This commit is contained in:
parent
1ca8db64ed
commit
8c8c97fcb0
1 changed files with 6 additions and 2 deletions
|
@ -126,10 +126,15 @@ int print_version()
|
|||
exit(0);
|
||||
}
|
||||
|
||||
pcap_t *p;
|
||||
void sig_handler(int sig)
|
||||
{
|
||||
fflush(stdout);
|
||||
if (logger) logger->vtbl->deinit();
|
||||
if (logger)
|
||||
logger->vtbl->deinit();
|
||||
printf("Cleaning %d remaining connection(s) from connection pool\n", destroy_all_conn());
|
||||
if(p)
|
||||
pcap_close(p);
|
||||
exit(0);
|
||||
}
|
||||
|
||||
|
@ -276,7 +281,6 @@ int main(argc,argv)
|
|||
int argc;
|
||||
char **argv;
|
||||
{
|
||||
pcap_t *p;
|
||||
int r;
|
||||
n_handler *n;
|
||||
#ifdef _WIN32
|
||||
|
|
Loading…
Reference in a new issue