From: Tobias Brunner Date: Tue, 18 Feb 2014 12:48:13 +0000 (+0100) Subject: pki: Fix minor resource leak on failure to read the private key in --req X-Git-Tag: 5.1.2rc2^0 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=435aed8287e2a3624a506069aeb475e6db4271e4;p=thirdparty%2Fstrongswan.git pki: Fix minor resource leak on failure to read the private key in --req --- 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);