diff options
author | Dan Carpenter <dan.carpenter@oracle.com> | 2019-01-05 21:18:03 +0300 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2019-01-10 23:32:30 +0300 |
commit | c715f89c4dab76317c773df2611af2dac4dea2b7 (patch) | |
tree | eb9411579d31029e2de2cfe39919262ebddfdbc2 /fs/cifs/dfs_cache.c | |
parent | 8428817dc40006dca0a531cfa06e89cb3b41790d (diff) | |
download | linux-c715f89c4dab76317c773df2611af2dac4dea2b7.tar.xz |
cifs: Fix a tiny potential memory leak
The most recent "it" allocation is leaked on this error path. I
believe that small allocations always succeed in current kernels so
this doesn't really affect run time.
Fixes: 54be1f6c1c37 ("cifs: Add DFS cache routines")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/dfs_cache.c')
-rw-r--r-- | fs/cifs/dfs_cache.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/cifs/dfs_cache.c b/fs/cifs/dfs_cache.c index cd63c4a70875..09b7d0d4f6e4 100644 --- a/fs/cifs/dfs_cache.c +++ b/fs/cifs/dfs_cache.c @@ -776,6 +776,7 @@ static int get_tgt_list(const struct dfs_cache_entry *ce, it->it_name = kstrndup(t->t_name, strlen(t->t_name), GFP_KERNEL); if (!it->it_name) { + kfree(it); rc = -ENOMEM; goto err_free_it; } |