From 435aed8287e2a3624a506069aeb475e6db4271e4 Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Tue, 18 Feb 2014 13:48:13 +0100 Subject: [PATCH] pki: Fix minor resource leak on failure to read the private key in --req --- src/pki/commands/req.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pki/commands/req.c b/src/pki/commands/req.c index 64609597d8..5b2c128b78 100644 --- a/src/pki/commands/req.c +++ b/src/pki/commands/req.c @@ -122,7 +122,8 @@ static int req() if (!chunk_from_fd(0, &chunk)) { fprintf(stderr, "reading private key failed: %s\n", strerror(errno)); - return 1; + error = ""; + goto end; } private = lib->creds->create(lib->creds, CRED_PRIVATE_KEY, type, BUILD_BLOB, chunk, BUILD_END); -- 2.47.2