diff options
author | Joachim Nilsson <troglobit@gmail.com> | 2019-10-08 20:31:51 +0200 |
---|---|---|
committer | Joachim Nilsson <troglobit@gmail.com> | 2019-10-08 20:31:51 +0200 |
commit | 1efb8be5ec6468afe52479f9d0bafda4239aa35f (patch) | |
tree | 02a86165e0058e6c6b60f204735486006f92125e /src/libnet_init.c | |
parent | 1a476db0b3b538d70d11c09339ac388628f70d27 (diff) | |
download | libnet-1efb8be5ec6468afe52479f9d0bafda4239aa35f.tar.gz |
libnet_destroy(): Don't close() l->fd if -1
Found by Valgrind
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
Diffstat (limited to 'src/libnet_init.c')
-rw-r--r-- | src/libnet_init.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libnet_init.c b/src/libnet_init.c index af52023..4a20c73 100644 --- a/src/libnet_init.c +++ b/src/libnet_init.c @@ -121,7 +121,8 @@ libnet_destroy(libnet_t *l) { if (l) { - close(l->fd); + if (l->fd != -1) + close(l->fd); free(l->device); libnet_clear_packet(l); free(l); |