lkml.org 
[lkml]   [2003]   [Mar]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectMemleak in ircomm_core
Hello!

There seems to be a memleak on error exit path. The same patch should apply
to 2.5 and 2.4

Found with help of smatch + enhanced unfree script.

Bye,
Oleg

===== net/irda/ircomm/ircomm_core.c 1.5 vs edited =====
--- 1.5/net/irda/ircomm/ircomm_core.c Tue Aug 6 22:23:24 2002
+++ edited/net/irda/ircomm/ircomm_core.c Mon Mar 10 00:10:10 2003
@@ -121,8 +121,10 @@
} else
ret = ircomm_open_tsap(self);

- if (ret < 0)
+ if (ret < 0) {
+ kfree(self);
return NULL;
+ }

self->service_type = service_type;
self->line = line;
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
\
 
 \ /
  Last update: 2005-03-22 13:33    [W:1.976 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site