diff options
-rw-r--r-- | wiretap/file_access.c | 3 | ||||
-rw-r--r-- | wsutil/plugins.c | 21 |
2 files changed, 12 insertions, 12 deletions
diff --git a/wiretap/file_access.c b/wiretap/file_access.c index 4448b36355..4e725afb0a 100644 --- a/wiretap/file_access.c +++ b/wiretap/file_access.c @@ -2724,13 +2724,14 @@ cleanup_open_routines(void) guint i; struct open_info *i_open; - if (open_routines != NULL) { + if (open_routines != NULL && open_info_arr) { for (i = 0, i_open = open_routines; i < open_info_arr->len; i++, i_open++) { if (i_open->extensions != NULL) g_strfreev(i_open->extensions_set); } g_array_free(open_info_arr, TRUE); + open_info_arr = NULL; } } diff --git a/wsutil/plugins.c b/wsutil/plugins.c index 73d79f4b8e..d916c9cf77 100644 --- a/wsutil/plugins.c +++ b/wsutil/plugins.c @@ -438,21 +438,20 @@ plugins_cleanup(void) plugin* prev; plugin* cur; - if (!plugin_list) - return; + if (plugin_list) { + prev = plugin_list; + cur = plugin_list->next; - prev = plugin_list; - cur = plugin_list->next; + do { + g_free(prev->name); + g_free(prev); + prev = cur; + cur = cur->next; + } while(cur); - do { g_free(prev->name); g_free(prev); - prev = cur; - cur = cur->next; - } while(cur); - - g_free(prev->name); - g_free(prev); + } g_slist_foreach(plugin_types, free_plugin_type, NULL); g_slist_free(plugin_types); |