From 37b5ce56a0650eeb8a3c6b788d1c9ba16139b313 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sat, 28 Mar 2015 17:30:31 +0100 Subject: rtp: Fix memory leak fixed by Andreas without mentioning it We allocate the msgb at entry of the method and we always need to msgb_free it. --- openbsc/src/libtrau/rtp_proxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'openbsc/src/libtrau') diff --git a/openbsc/src/libtrau/rtp_proxy.c b/openbsc/src/libtrau/rtp_proxy.c index 82f4063b2..be00dde3b 100644 --- a/openbsc/src/libtrau/rtp_proxy.c +++ b/openbsc/src/libtrau/rtp_proxy.c @@ -394,7 +394,7 @@ static int rtp_socket_read(struct rtp_socket *rs, struct rtp_sub_socket *rss) rc = read(rss->bfd.fd, msg->data, RTP_ALLOC_SIZE); if (rc <= 0) { rss->bfd.when &= ~BSC_FD_READ; - return rc; + goto out_free; } msgb_put(msg, rc); -- cgit v1.2.3