From b1f9ef6073b3ca1820d23f0b600c2e5ab227435e Mon Sep 17 00:00:00 2001 From: Gregor Richards Date: Tue, 29 Nov 2016 23:31:35 -0500 Subject: [PATCH] Since I've allocated net_ifinfo, I'd better free it in all returns --- libretro-common/net/net_natt.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libretro-common/net/net_natt.c b/libretro-common/net/net_natt.c index a3f28534aa..2bd7d1f865 100644 --- a/libretro-common/net/net_natt.c +++ b/libretro-common/net/net_natt.c @@ -167,7 +167,10 @@ bool natt_open_port_any(struct natt_status *status, uint16_t port, enum socket_p if ((list = (struct net_ifinfo *) calloc(1, sizeof(struct net_ifinfo))) == NULL) return false; if (!net_ifinfo_new(list)) + { + free(list); return false; + } /* loop through them */ for (i = 0; i < list->size; i++)