diff options
author | Rich Salz <rsalz@openssl.org> | 2015-05-01 16:02:07 +0200 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2015-05-01 16:02:07 +0200 |
commit | b548a1f11c06ccdfa4f52a539912d22d77ee309e (patch) | |
tree | 37ff8792ddf09e4805aa3ba76b805923d3c52734 /crypto/comp | |
parent | Fix some typo's, silence warnings. (diff) | |
download | openssl-b548a1f11c06ccdfa4f52a539912d22d77ee309e.tar.xz openssl-b548a1f11c06ccdfa4f52a539912d22d77ee309e.zip |
free null cleanup finale
Don't check for NULL before calling OPENSSL_free
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/comp')
-rw-r--r-- | crypto/comp/c_zlib.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/crypto/comp/c_zlib.c b/crypto/comp/c_zlib.c index aa03f8fda1..4508e7f634 100644 --- a/crypto/comp/c_zlib.c +++ b/crypto/comp/c_zlib.c @@ -151,8 +151,7 @@ static int zlib_stateful_init(COMP_CTX *ctx) CRYPTO_set_ex_data(&ctx->ex_data, zlib_stateful_ex_idx, state); return 1; err: - if (state) - OPENSSL_free(state); + OPENSSL_free(state); return 0; } @@ -606,18 +605,14 @@ static long bio_zlib_ctrl(BIO *b, int cmd, long num, void *ptr) } if (ibs != -1) { - if (ctx->ibuf) { - OPENSSL_free(ctx->ibuf); - ctx->ibuf = NULL; - } + OPENSSL_free(ctx->ibuf); + ctx->ibuf = NULL; ctx->ibufsize = ibs; } if (obs != -1) { - if (ctx->obuf) { - OPENSSL_free(ctx->obuf); - ctx->obuf = NULL; - } + OPENSSL_free(ctx->obuf); + ctx->obuf = NULL; ctx->obufsize = obs; } ret = 1; |