]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] Fix memleak in ircomm_core
authorAndrew Morton <akpm@digeo.com>
Mon, 10 Mar 2003 15:42:24 +0000 (07:42 -0800)
committerLinus Torvalds <torvalds@home.transmeta.com>
Mon, 10 Mar 2003 15:42:24 +0000 (07:42 -0800)
Patch from Oleg Drokin <green@linuxhacker.ru>

There seems to be a memleak on error exit path.

net/irda/ircomm/ircomm_core.c

index 83016a01364b1746f8b47ea5df5441447f360933..122e6297130633d1701f7fe363162a584c47fe18 100644 (file)
@@ -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;