aboutsummaryrefslogtreecommitdiffstats
path: root/src/libstrongswan/plugins/pgp/pgp_encoder.c
diff options
context:
space:
mode:
authorMartin Willi <martin@revosec.ch>2012-07-09 17:15:52 +0200
committerMartin Willi <martin@revosec.ch>2012-07-16 14:55:06 +0200
commit87dd205b61ae8c0125b459959fcc7349fa27bb74 (patch)
treea6c138a105bf40ce5a4b1b60047ed3a76cbe22ca /src/libstrongswan/plugins/pgp/pgp_encoder.c
parente185612dd8011ca4f3de460640f74e6a652cbf32 (diff)
downloadstrongswan-87dd205b61ae8c0125b459959fcc7349fa27bb74.tar.bz2
strongswan-87dd205b61ae8c0125b459959fcc7349fa27bb74.tar.xz
Add a return value to hasher_t.allocate_hash()
Diffstat (limited to 'src/libstrongswan/plugins/pgp/pgp_encoder.c')
-rw-r--r--src/libstrongswan/plugins/pgp/pgp_encoder.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/libstrongswan/plugins/pgp/pgp_encoder.c b/src/libstrongswan/plugins/pgp/pgp_encoder.c
index 9043cdb9f..d16d1d71b 100644
--- a/src/libstrongswan/plugins/pgp/pgp_encoder.c
+++ b/src/libstrongswan/plugins/pgp/pgp_encoder.c
@@ -44,8 +44,12 @@ static bool build_v3_fingerprint(chunk_t *encoding, va_list args)
{
e = chunk_skip(e, 1);
}
- hasher->allocate_hash(hasher, n, NULL);
- hasher->allocate_hash(hasher, e, encoding);
+ if (!hasher->allocate_hash(hasher, n, NULL) ||
+ !hasher->allocate_hash(hasher, e, encoding))
+ {
+ hasher->destroy(hasher);
+ return FALSE;
+ }
hasher->destroy(hasher);
return TRUE;
}