summaryrefslogtreecommitdiff
path: root/cipher/cipher.c
diff options
context:
space:
mode:
authorWerner Koch <wk@gnupg.org>2011-04-19 16:22:48 +0200
committerWerner Koch <wk@gnupg.org>2011-04-19 16:22:48 +0200
commit1351cc95b5ee70fde396f8d5754214ef6db4baec (patch)
treeb1d0ed32eba13178d485abeda6f5e216c4a23729 /cipher/cipher.c
parent8ecc5614cc40a2d37c3ca704d06470a38c76983d (diff)
downloadlibgcrypt-1351cc95b5ee70fde396f8d5754214ef6db4baec.tar.gz
Make sure to return correct error codes for secmem failures.
ERRNO was not always set and thus it could happen that a misleading error code was returned form a malloc functions. Fix was to set ERRNO. At one place we also switched to the newer gpg_err_code_from_syserror which makes sure to return a special error code in case ERRNO is not set at all.
Diffstat (limited to 'cipher/cipher.c')
-rw-r--r--cipher/cipher.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cipher/cipher.c b/cipher/cipher.c
index 90fdb173..b0a532af 100644
--- a/cipher/cipher.c
+++ b/cipher/cipher.c
@@ -786,7 +786,7 @@ gcry_cipher_open (gcry_cipher_hd_t *handle,
h = gcry_calloc (1, size);
if (! h)
- err = gpg_err_code_from_errno (errno);
+ err = gpg_err_code_from_syserror ();
else
{
size_t off = 0;