public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs_io: fix memory leak in add_enckey
@ 2019-11-07 16:50 Eric Sandeen
  2019-11-07 20:29 ` Bill O'Donnell
  2019-11-07 21:46 ` Eric Biggers
  0 siblings, 2 replies; 8+ messages in thread
From: Eric Sandeen @ 2019-11-07 16:50 UTC (permalink / raw)
  To: linux-xfs; +Cc: Eric Biggers

Invalid arguments to add_enckey will leak the "arg" allocation,
so fix that.

Fixes: ba71de04 ("xfs_io/encrypt: add 'add_enckey' command")
Fixes-coverity-id: 1454644
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
---

diff --git a/io/encrypt.c b/io/encrypt.c
index 17d61cfb..c6a4e190 100644
--- a/io/encrypt.c
+++ b/io/encrypt.c
@@ -696,6 +696,7 @@ add_enckey_f(int argc, char **argv)
 				goto out;
 			break;
 		default:
+			free(arg);
 			return command_usage(&add_enckey_cmd);
 		}
 	}


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-11-14 21:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-11-07 16:50 [PATCH] xfs_io: fix memory leak in add_enckey Eric Sandeen
2019-11-07 20:29 ` Bill O'Donnell
2019-11-07 21:46 ` Eric Biggers
2019-11-07 21:58   ` Eric Sandeen
2019-11-11 15:13     ` Eric Sandeen
2019-11-11 17:27       ` Eric Biggers
2019-11-11 18:07         ` Eric Sandeen
2019-11-14 21:09           ` Eric Biggers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox