浏览代码

9p: we are leaking glock.client_id in v9fs_file_getlock()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Al Viro 10 年之前
父节点
当前提交
ce85dd58ad
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      fs/9p/vfs_file.c

+ 2 - 0
fs/9p/vfs_file.c

@@ -37,6 +37,7 @@
 #include <asm/uaccess.h>
 #include <asm/uaccess.h>
 #include <linux/idr.h>
 #include <linux/idr.h>
 #include <linux/uio.h>
 #include <linux/uio.h>
+#include <linux/slab.h>
 #include <net/9p/9p.h>
 #include <net/9p/9p.h>
 #include <net/9p/client.h>
 #include <net/9p/client.h>
 
 
@@ -286,6 +287,7 @@ static int v9fs_file_getlock(struct file *filp, struct file_lock *fl)
 			fl->fl_end = glock.start + glock.length - 1;
 			fl->fl_end = glock.start + glock.length - 1;
 		fl->fl_pid = glock.proc_id;
 		fl->fl_pid = glock.proc_id;
 	}
 	}
+	kfree(glock.client_id);
 	return res;
 	return res;
 }
 }