Skip to contentSkip to conversation

irda: irttp: fix memory leak in irttp_open_tsap() error path

PATCH Applied Tommi Rantala 2 participants 2 messages Nov 26, 2012 – Nov 28, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 irda: irttp: fix memory leak in irttp_open_tsap() error path

Cleanup the memory we allocated earlier in irttp_open_tsap() when we hit this error path. The leak goes back to at least 1da177e4 ("Linux-2.6.12-rc2").

Discovered with Trinity (the syscall fuzzer).

---
 net/irda/irttp.c |    1 +
 1 file changed, 1 insertion(+)
net/irda/irttp.c +1 -0
index 1002e33..ae43c62 100644
@@ -441,6 +441,7 @@ struct tsap_cb *irttp_open_tsap(__u8 stsap_sel, int credit, notify_t *notify)
 	lsap = irlmp_open_lsap(stsap_sel, &ttp_notify, 0);
 	if (lsap == NULL) {
 		IRDA_DEBUG(0, "%s: unable to allocate LSAP!!\n", __func__);
+		__irttp_close_tsap(self);
 		return NULL;
 	}
 
Signature · 1 line
1.7.9.5
maintainer Applied
#1 lore raw

From: Tommi Rantala <[email protected]>
Date: Mon, 26 Nov 2012 16:16:44 +0200

Quoted 7 lines

Cleanup the memory we allocated earlier in irttp_open_tsap() when we hit this error path. The leak goes back to at least 1da177e4 ("Linux-2.6.12-rc2").

Discovered with Trinity (the syscall fuzzer).

Applied, thanks.