summaryrefslogtreecommitdiffstats
path: root/crypto/comp/comp_lib.c
diff options
context:
space:
mode:
authorRich Salz <rsalz@openssl.org>2018-04-26 14:02:24 -0400
committerRich Salz <rsalz@openssl.org>2018-04-26 14:02:24 -0400
commitfe1128dc2a6e7aae9010cf6595c78245e0eefd46 (patch)
treede62e713f375adaefd7e6bfd8491575c0fc530a3 /crypto/comp/comp_lib.c
parent74a8acbdfb2c7f398d1ae2fe914cd32b437f6df4 (diff)
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/comp_lib.c')
-rw-r--r--crypto/comp/comp_lib.c5
1 files changed, 4 insertions, 1 deletions
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);