diff options
author | Jonas Maebe <jonas.maebe@elis.ugent.be> | 2013-12-02 22:07:02 +0100 |
---|---|---|
committer | Kurt Roeckx <kurt@roeckx.be> | 2014-12-10 18:35:17 +0100 |
commit | d00b1d62d62036dc21c78658a28da4a6279e6fe2 (patch) | |
tree | 76316631d878795bf61f3f3c884949e04872a836 /ssl | |
parent | 02a62d1a4ab711e935defb6e61c2564130ff8627 (diff) |
SSL_COMP_add_compression_method: exit if allocating the new compression method struct fails
Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Matt Caswell <matt@openssl.org>
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/ssl_ciph.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ssl/ssl_ciph.c b/ssl/ssl_ciph.c index 1599d7971c..133d9d9b2f 100644 --- a/ssl/ssl_ciph.c +++ b/ssl/ssl_ciph.c @@ -1962,6 +1962,13 @@ int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm) MemCheck_off(); comp=(SSL_COMP *)OPENSSL_malloc(sizeof(SSL_COMP)); + if (comp == NULL) + { + MemCheck_on(); + SSLerr(SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD,ERR_R_MALLOC_FAILURE); + return(1); + } + comp->id=id; comp->method=cm; load_builtin_compressions(); |