[PATCH] mISDNuser: mISDNcapid: fix memory leak when using CAPIFLAG_HIGHJACKING

Christoph Schulz <[email protected]> Sat, 11 Feb 2017 12:54:41 +0100
Newsgroups gmane.linux.isdn.i4l.user
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

If using a tty for sending/receiving B3 data, the mc buffer for data sent is
not freed by ncciDataConf() because this is done only by AnswerDataB3Req()
which is not called when using a tty. Fix this by explicitly freeing the mc
buffer when a tty is used.

Signed-off-by: Christoph Schulz <[email protected]>
- ---
 capi20/ncci.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/capi20/ncci.c b/capi20/ncci.c
index 1307d20..ea479eb 100644
- --- a/capi20/ncci.c
+++ b/capi20/ncci.c
@@ -1175,6 +1175,8 @@ static void ncciDataConf(struct mNCCI *ncci, struct mc_buf *mc)
 	pthread_mutex_unlock(&ncci->lock);
 	if (do_answer)
 		AnswerDataB3Req(ncci, mc, CapiNoError);
+	else
+		free_mc_buf(mc);
 	SendDataB3Down(ncci, 0);
 	return;
 }
- -- 
2.10.2
-----BEGIN PGP SIGNATURE-----

iEYEARECAAYFAlie+4EACgkQL11jCnyQ5OxXgACbB8ynrCZrZTOwGemeCUZ5E5bi
GQoAn18wMToEQUHE3KGmiHPDvCdniubr
=KuUR
-----END PGP SIGNATURE-----