From c9bb6b8282eb5c829bc4cb07f4bc2e53f409c0c5 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 17 Apr 2017 17:09:26 -0700 Subject: 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 --- editcap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'editcap.c') 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 -- cgit v1.2.1