1 From 10b8c7dff5d3633b69e77f57d404dab54ead3787 Mon Sep 17 00:00:00 2001
2 From: Cong Ding <dinggnu@gmail.com>
3 Date: Tue, 22 Jan 2013 19:20:58 -0500
4 Subject: fs/cifs/cifs_dfs_ref.c: fix potential memory leakage
6 From: Cong Ding <dinggnu@gmail.com>
8 commit 10b8c7dff5d3633b69e77f57d404dab54ead3787 upstream.
10 When it goes to error through line 144, the memory allocated to *devname is
11 not freed, and the caller doesn't free it either in line 250. So we free the
12 memroy of *devname in function cifs_compose_mount_options() when it goes to
15 Signed-off-by: Cong Ding <dinggnu@gmail.com>
16 Reviewed-by: Jeff Layton <jlayton@redhat.com>
17 Signed-off-by: Steve French <smfrench@gmail.com>
18 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
21 fs/cifs/cifs_dfs_ref.c | 2 ++
22 1 file changed, 2 insertions(+)
24 --- a/fs/cifs/cifs_dfs_ref.c
25 +++ b/fs/cifs/cifs_dfs_ref.c
26 @@ -226,6 +226,8 @@ compose_mount_options_out:
27 compose_mount_options_err:
29 mountdata = ERR_PTR(rc);
32 goto compose_mount_options_out;