From 30f8ceebbad01f1040b492599d26e0f01e0824f1 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Mon, 17 Jul 2017 18:56:38 -0700 Subject: Remove unnecessary test. The default case ends with return, so the pointer won't be null by the time out exit the case statement - either a non-default case is processed and tag_ptr hasn't been set to null, or the default case is processed and you return before getting there. That also means we don't need to set tag_ptr to null in that case. Fixes CIDs 1415436. Change-Id: I21ada7a308d888b4cbb8557197a2e30bda118f44 Reviewed-on: https://code.wireshark.org/review/22691 Reviewed-by: Guy Harris --- wiretap/erf.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'wiretap/erf.c') diff --git a/wiretap/erf.c b/wiretap/erf.c index 34c0f34b47..a05a6c533c 100644 --- a/wiretap/erf.c +++ b/wiretap/erf.c @@ -1051,13 +1051,10 @@ static void erf_write_wtap_option_to_host_tag(wtap_block_t block _U_, break; default: erf_meta_tag_free(tag_ptr); - tag_ptr = NULL; return; } - if (tag_ptr) - g_ptr_array_add(section_ptr->tags, tag_ptr); - + g_ptr_array_add(section_ptr->tags, tag_ptr); } static void erf_write_wtap_option_to_interface_tag(wtap_block_t block _U_, -- cgit v1.2.3