aboutsummaryrefslogtreecommitdiffstats
path: root/editcap.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-04-17 17:09:26 -0700
committerGuy Harris <guy@alum.mit.edu>2017-04-18 00:10:12 +0000
commitc9bb6b8282eb5c829bc4cb07f4bc2e53f409c0c5 (patch)
treed7083e71b486421682dee65a61b309546d22bc34 /editcap.c
parent3fac48da689998ca0942ec2bdcb0dabd77e04a36 (diff)
Don't close a wtap that you don't have open in the first place.
Change-Id: I4d9d539957d06cb3568df287eb36ecc34677373f Reviewed-on: https://code.wireshark.org/review/21170 Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'editcap.c')
-rw-r--r--editcap.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/editcap.c b/editcap.c
index 7d1e2a40c5..5efa2cbc8f 100644
--- a/editcap.c
+++ b/editcap.c
@@ -1906,7 +1906,8 @@ clean_exit:
wtap_block_array_free(shb_hdrs);
wtap_block_array_free(nrb_hdrs);
g_free(idb_inf);
- wtap_close(wth);
+ if (wth != NULL)
+ wtap_close(wth);
wtap_cleanup();
free_progdirs();
#ifdef HAVE_PLUGINS