From e3ccf2a93c7cc7358a874b2b998431553230ad86 Mon Sep 17 00:00:00 2001 From: 7u83 <7u83@mail.ru> Date: Fri, 26 Aug 2022 19:33:57 +0200 Subject: [PATCH] Fixed memroy leak --- src/wtp/discovery.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/wtp/discovery.c b/src/wtp/discovery.c index bd0ca569..b6f1d604 100644 --- a/src/wtp/discovery.c +++ b/src/wtp/discovery.c @@ -214,7 +214,8 @@ struct cw_DiscoveryResults * cw_run_discovery(struct cw_Conn *conn, const char * if (brc < 0) { cw_log(LOG_ERR, "Can't bind to %s", sock_addr2str(&bind_address, sock_buf)); - return 0; + results = 0; + goto errX; } } @@ -233,6 +234,7 @@ struct cw_DiscoveryResults * cw_run_discovery(struct cw_Conn *conn, const char * } +errX: freeaddrinfo(res0);