From e31f1b918cb7186b6d61c791e29a72f3415b42ec Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Thu, 22 Nov 2018 13:36:20 +0100 Subject: [PATCH] mdns.c: Fix accessing potentially uninitialized variable myprobe_inpkt.pbuf may not be set to NULL in mdns_handle_probe_tiebreaking() --- src/apps/mdns/mdns.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/apps/mdns/mdns.c b/src/apps/mdns/mdns.c index d7ef6139..30bf4e67 100644 --- a/src/apps/mdns/mdns.c +++ b/src/apps/mdns/mdns.c @@ -834,6 +834,7 @@ mdns_handle_probe_tiebreaking(struct netif *netif, struct mdns_packet *pkt) */ mdns_define_probe_rrs_to_send(netif, &myprobe_msg); memset(&myprobe_outpkt, 0, sizeof(myprobe_outpkt)); + memset(&myprobe_inpkt, 0, sizeof(myprobe_inpkt)); res = mdns_create_outpacket(netif, &myprobe_msg, &myprobe_outpkt); if (res != ERR_OK) { goto cleanup; @@ -1017,9 +1018,8 @@ mdns_handle_probe_tiebreaking(struct netif *netif, struct mdns_packet *pkt) } cleanup: - if (myprobe_inpkt.pbuf) { + if (myprobe_inpkt.pbuf != NULL) { pbuf_free(myprobe_inpkt.pbuf); - myprobe_inpkt.pbuf = NULL; } }