diff options
author | Rich Salz <rsalz@openssl.org> | 2018-03-27 16:25:08 -0400 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2018-03-27 16:25:08 -0400 |
commit | e6e9170d6e28038768895e1af18e3aad8093bf4b (patch) | |
tree | 62f594f0968ff8d6c27795377a102e4aab373b00 /crypto/comp/comp_lib.c | |
parent | 98c03302fb7b855647aa14022f61f5fb272e514a (diff) |
Allow NULL for some _free routines.
Based on the description in https://github.com/openssl/openssl/pull/5757,
this re-implements the "allow NULL to be passed" behavior of a number of
xxx_free routines. I also fixed up some egregious formatting errors
that were nearby.
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5761)
Diffstat (limited to 'crypto/comp/comp_lib.c')
-rw-r--r-- | crypto/comp/comp_lib.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/crypto/comp/comp_lib.c b/crypto/comp/comp_lib.c index 5bed1876a8..c199bb352f 100644 --- a/crypto/comp/comp_lib.c +++ b/crypto/comp/comp_lib.c @@ -45,6 +45,8 @@ const char *COMP_get_name(const COMP_METHOD *meth) void COMP_CTX_free(COMP_CTX *ctx) { + if (ctx == NULL) + return; if (ctx->meth->finish != NULL) ctx->meth->finish(ctx); |