From fc95763f7bf718e9c96aad18d54e23eed840032c Mon Sep 17 00:00:00 2001 From: Felix Buehler Date: Fri, 3 Apr 2020 15:39:33 +0200 Subject: [PATCH] remove goto-labels from wireless_info --- src/print_wireless_info.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/print_wireless_info.c b/src/print_wireless_info.c index 37a963f..ad20645 100644 --- a/src/print_wireless_info.c +++ b/src/print_wireless_info.c @@ -519,7 +519,12 @@ void print_wireless_info(yajl_gen json_gen, char *buffer, const char *interface, if (ipv6_address == NULL) { START_COLOR("color_bad"); outwalk += sprintf(outwalk, "%s", format_down); - goto out; + + END_COLOR; + free(ipv4_address); + free(ipv6_address); + OUTPUT_FULL_TEXT(buffer); + return; } else { prefer_ipv4 = false; } @@ -611,7 +616,6 @@ void print_wireless_info(yajl_gen json_gen, char *buffer, const char *interface, const size_t num = sizeof(placeholders) / sizeof(placeholder_t); buffer = format_placeholders(walk, &placeholders[0], num); -out: END_COLOR; free(ipv4_address); free(ipv6_address);