pki: Fix minor resource leak on failure to read the private key in --req

This commit is contained in:
Tobias Brunner 2014-02-18 13:48:13 +01:00
parent 5a04056295
commit 435aed8287
1 changed files with 2 additions and 1 deletions

View File

@ -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);