From 9ea87938324c8e5274af7fb1c3e832473ea5cdbe Mon Sep 17 00:00:00 2001 From: mmcc <> Date: Wed, 23 Dec 2015 20:37:23 +0000 Subject: remove NULL-checks before free() --- src/lib/libcrypto/comp/c_zlib.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/lib/libcrypto/comp') diff --git a/src/lib/libcrypto/comp/c_zlib.c b/src/lib/libcrypto/comp/c_zlib.c index 4951ade810..d9a3359313 100644 --- a/src/lib/libcrypto/comp/c_zlib.c +++ b/src/lib/libcrypto/comp/c_zlib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: c_zlib.c,v 1.17 2014/11/03 16:58:28 tedu Exp $ */ +/* $OpenBSD: c_zlib.c,v 1.18 2015/12/23 20:37:23 mmcc Exp $ */ #include #include #include @@ -524,18 +524,14 @@ bio_zlib_ctrl(BIO *b, int cmd, long num, void *ptr) } if (ibs != -1) { - if (ctx->ibuf) { - free(ctx->ibuf); - ctx->ibuf = NULL; - } + free(ctx->ibuf); + ctx->ibuf = NULL; ctx->ibufsize = ibs; } if (obs != -1) { - if (ctx->obuf) { - free(ctx->obuf); - ctx->obuf = NULL; - } + free(ctx->obuf); + ctx->obuf = NULL; ctx->obufsize = obs; } ret = 1; -- cgit v1.2.3-55-g6feb