lkml.org 
[lkml]   [2003]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[2.5] memleak in drivers/char/vt.c
Hello!

Seems there is a memleak on error exit path in drivers/char/vt.c in current bk,
here's the patch. Found with help of smatch + enhanced unfree script.


===== drivers/char/vt.c 1.34 vs edited =====
--- 1.34/drivers/char/vt.c Fri Mar 7 08:27:16 2003
+++ edited/drivers/char/vt.c Fri Mar 7 19:25:45 2003
@@ -747,8 +747,10 @@
screenbuf_size = new_screen_size;

err = resize_screen(currcons, new_cols, new_rows);
- if (err)
+ if (err) {
+ kfree(newscreen);
return err;
+ }

rlth = min(old_row_size, new_row_size);
rrem = new_row_size - rlth;
Bye,
Oleg
-
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:0.014 / U:1.368 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site