summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFelix Buehler <account@buehler.rocks>2020-04-03 15:39:33 +0200
committerFelix Buehler <account@buehler.rocks>2020-04-03 16:01:55 +0200
commitfc95763f7bf718e9c96aad18d54e23eed840032c (patch)
treead4245ec0e79e5ba1490509d61eb779d63862aaf /src
parentae2566f28e4a54c47d68c87c87bf335521c5b13b (diff)
remove goto-labels from wireless_info
Diffstat (limited to 'src')
-rw-r--r--src/print_wireless_info.c8
1 files 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);