summaryrefslogtreecommitdiff
path: root/lib/libcrypto/pem
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2014-04-17 17:30:23 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2014-04-17 17:30:23 +0000
commit12389820fc8dfa2e85dc977ba297ea1e7063ec53 (patch)
tree6e3fa4089e1acac84c3e503e9dbb6fd8eb752fd4 /lib/libcrypto/pem
parentc8d470c0e3671f31f54f4e77700a093674ea97c5 (diff)
fix some of the leaks
ok miod@ looks good deraadt@
Diffstat (limited to 'lib/libcrypto/pem')
-rw-r--r--lib/libcrypto/pem/pvkfmt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libcrypto/pem/pvkfmt.c b/lib/libcrypto/pem/pvkfmt.c
index 8da8e77973c..59af2020ab8 100644
--- a/lib/libcrypto/pem/pvkfmt.c
+++ b/lib/libcrypto/pem/pvkfmt.c
@@ -753,8 +753,10 @@ static EVP_PKEY *do_PVK_body(const unsigned char **in,
return NULL;
}
if (!derive_pvk_key(keybuf, p, saltlen,
- (unsigned char *)psbuf, inlen))
+ (unsigned char *)psbuf, inlen)) {
+ free(enctmp);
return NULL;
+ }
p += saltlen;
/* Copy BLOBHEADER across, decrypt rest */
memcpy(enctmp, p, 8);