Jelajahi Sumber

nfs: fix unlikely memory leak

I'll admit that it's unlikely for the first allocation to fail and
the second one to succeed.  I won't be offended if you ignore this
patch.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Dan Carpenter 15 tahun lalu
induk
melakukan
7dd08a570d
1 mengubah file dengan 1 tambahan dan 0 penghapusan
  1. 1 0
      fs/nfs/nfs4proc.c

+ 1 - 0
fs/nfs/nfs4proc.c

@@ -5107,6 +5107,7 @@ static int nfs41_proc_async_sequence(struct nfs_client *clp,
 	res = kzalloc(sizeof(*res), GFP_KERNEL);
 	if (!args || !res) {
 		kfree(args);
+		kfree(res);
 		nfs_put_client(clp);
 		return -ENOMEM;
 	}