diff options
author | Rich Salz <rsalz@openssl.org> | 2018-04-26 14:02:24 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2018-04-26 14:02:24 -0400 |
commit | fe1128dc2a6e7aae9010cf6595c78245e0eefd46 (patch) | |
tree | de62e713f375adaefd7e6bfd8491575c0fc530a3 /crypto/comp | |
parent | 74a8acbdfb2c7f398d1ae2fe914cd32b437f6df4 (diff) | |
download | openssl-new-fe1128dc2a6e7aae9010cf6595c78245e0eefd46.tar.gz |
Fix last(?) batch of malloc-NULL places
Add a script to find them in the future
Reviewed-by: Bernd Edlinger <bernd.edlinger@hotmail.de>
(Merged from https://github.com/openssl/openssl/pull/6103)
Diffstat (limited to 'crypto/comp')
-rw-r--r-- | crypto/comp/comp_err.c | 3 | ||||
-rw-r--r-- | crypto/comp/comp_lib.c | 5 |
2 files changed, 6 insertions, 2 deletions
diff --git a/crypto/comp/comp_err.c b/crypto/comp/comp_err.c index 5aff502b7a..2dca315cf1 100644 --- a/crypto/comp/comp_err.c +++ b/crypto/comp/comp_err.c @@ -1,6 +1,6 @@ /* * Generated by util/mkerr.pl DO NOT EDIT - * Copyright 1995-2017 The OpenSSL Project Authors. All Rights Reserved. + * Copyright 1995-2018 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy @@ -18,6 +18,7 @@ static const ERR_STRING_DATA COMP_str_functs[] = { {ERR_PACK(ERR_LIB_COMP, COMP_F_BIO_ZLIB_NEW, 0), "bio_zlib_new"}, {ERR_PACK(ERR_LIB_COMP, COMP_F_BIO_ZLIB_READ, 0), "bio_zlib_read"}, {ERR_PACK(ERR_LIB_COMP, COMP_F_BIO_ZLIB_WRITE, 0), "bio_zlib_write"}, + {ERR_PACK(ERR_LIB_COMP, COMP_F_COMP_CTX_NEW, 0), "COMP_CTX_new"}, {0, NULL} }; diff --git a/crypto/comp/comp_lib.c b/crypto/comp/comp_lib.c index e509f5957b..6ae2114496 100644 --- a/crypto/comp/comp_lib.c +++ b/crypto/comp/comp_lib.c @@ -12,14 +12,17 @@ #include <string.h> #include <openssl/objects.h> #include <openssl/comp.h> +#include <openssl/err.h> #include "comp_lcl.h" COMP_CTX *COMP_CTX_new(COMP_METHOD *meth) { COMP_CTX *ret; - if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) + if ((ret = OPENSSL_zalloc(sizeof(*ret))) == NULL) { + COMPerr(COMP_F_COMP_CTX_NEW, ERR_R_MALLOC_FAILURE); return NULL; + } ret->meth = meth; if ((ret->meth->init != NULL) && !ret->meth->init(ret)) { OPENSSL_free(ret); |