From 14fe8153c8d44c750d126184e570106a845c708a Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Mon, 10 Mar 2003 07:42:24 -0800 Subject: [PATCH] [PATCH] Fix memleak in ircomm_core Patch from Oleg Drokin There seems to be a memleak on error exit path. --- net/irda/ircomm/ircomm_core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/irda/ircomm/ircomm_core.c b/net/irda/ircomm/ircomm_core.c index 83016a01364b1..122e629713063 100644 --- a/net/irda/ircomm/ircomm_core.c +++ b/net/irda/ircomm/ircomm_core.c @@ -119,8 +119,10 @@ struct ircomm_cb *ircomm_open(notify_t *notify, __u8 service_type, int line) } else ret = ircomm_open_tsap(self); - if (ret < 0) + if (ret < 0) { + kfree(self); return NULL; + } self->service_type = service_type; self->line = line; -- 2.53.0