diff options
author | Matt Caswell <matt@openssl.org> | 2016-05-17 15:08:43 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-05-18 10:47:15 +0100 |
commit | 569d0646096e6c7e07b9b89b04204eef934c3b69 (patch) | |
tree | 8e649d1b033ec73cb6134123aa0024daf2394387 /crypto/dsa | |
parent | 6ef020c988bb508842dfcd517a4b41cae214f641 (diff) | |
download | openssl-569d0646096e6c7e07b9b89b04204eef934c3b69.tar.gz |
Add some error messages for malloc fails
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/dsa')
-rw-r--r-- | crypto/dsa/dsa_err.c | 3 | ||||
-rw-r--r-- | crypto/dsa/dsa_meth.c | 7 |
2 files changed, 9 insertions, 1 deletions
diff --git a/crypto/dsa/dsa_err.c b/crypto/dsa/dsa_err.c index 9c5ae981b7..038a031d09 100644 --- a/crypto/dsa/dsa_err.c +++ b/crypto/dsa/dsa_err.c @@ -33,6 +33,9 @@ static ERR_STRING_DATA DSA_str_functs[] = { {ERR_FUNC(DSA_F_DSA_BUILTIN_PARAMGEN2), "dsa_builtin_paramgen2"}, {ERR_FUNC(DSA_F_DSA_DO_SIGN), "DSA_do_sign"}, {ERR_FUNC(DSA_F_DSA_DO_VERIFY), "DSA_do_verify"}, + {ERR_FUNC(DSA_F_DSA_METH_DUP), "DSA_meth_dup"}, + {ERR_FUNC(DSA_F_DSA_METH_NEW), "DSA_meth_new"}, + {ERR_FUNC(DSA_F_DSA_METH_SET1_NAME), "DSA_meth_set1_name"}, {ERR_FUNC(DSA_F_DSA_NEW_METHOD), "DSA_new_method"}, {ERR_FUNC(DSA_F_DSA_PARAM_DECODE), "dsa_param_decode"}, {ERR_FUNC(DSA_F_DSA_PRINT_FP), "DSA_print_fp"}, diff --git a/crypto/dsa/dsa_meth.c b/crypto/dsa/dsa_meth.c index 57bc9f0971..5ce93396cf 100644 --- a/crypto/dsa/dsa_meth.c +++ b/crypto/dsa/dsa_meth.c @@ -17,6 +17,7 @@ #include "dsa_locl.h" #include <string.h> +#include <openssl/err.h> DSA_METHOD *DSA_meth_new(const char *name, int flags) { @@ -26,6 +27,7 @@ DSA_METHOD *DSA_meth_new(const char *name, int flags) dsam->name = OPENSSL_strdup(name); if (dsam->name == NULL) { OPENSSL_free(dsam); + DSAerr(DSA_F_DSA_METH_NEW, ERR_R_MALLOC_FAILURE); return NULL; } dsam->flags = flags; @@ -54,6 +56,7 @@ DSA_METHOD *DSA_meth_dup(const DSA_METHOD *dsam) ret->name = OPENSSL_strdup(dsam->name); if (ret->name == NULL) { OPENSSL_free(ret); + DSAerr(DSA_F_DSA_METH_DUP, ERR_R_MALLOC_FAILURE); return NULL; } } @@ -71,8 +74,10 @@ int DSA_meth_set1_name(DSA_METHOD *dsam, const char *name) char *tmpname; tmpname = OPENSSL_strdup(name); - if (tmpname == NULL) + if (tmpname == NULL) { + DSAerr(DSA_F_DSA_METH_SET1_NAME, ERR_R_MALLOC_FAILURE); return 0; + } OPENSSL_free(dsam->name); dsam->name = tmpname; |