diff options
author | mmcc <> | 2015-12-23 20:37:23 +0000 |
---|---|---|
committer | mmcc <> | 2015-12-23 20:37:23 +0000 |
commit | 9ea87938324c8e5274af7fb1c3e832473ea5cdbe (patch) | |
tree | 6a0bcb7c2382a4d5e6eb2313bd14754a09b5deb7 /src/lib/libcrypto/comp | |
parent | 6f23276bbcf82076c4ba8d386890d184a7e7f0a6 (diff) | |
download | openbsd-9ea87938324c8e5274af7fb1c3e832473ea5cdbe.tar.gz openbsd-9ea87938324c8e5274af7fb1c3e832473ea5cdbe.tar.bz2 openbsd-9ea87938324c8e5274af7fb1c3e832473ea5cdbe.zip |
remove NULL-checks before free()
Diffstat (limited to 'src/lib/libcrypto/comp')
-rw-r--r-- | src/lib/libcrypto/comp/c_zlib.c | 14 |
1 files changed, 5 insertions, 9 deletions
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 @@ | |||
1 | /* $OpenBSD: c_zlib.c,v 1.17 2014/11/03 16:58:28 tedu Exp $ */ | 1 | /* $OpenBSD: c_zlib.c,v 1.18 2015/12/23 20:37:23 mmcc Exp $ */ |
2 | #include <stdio.h> | 2 | #include <stdio.h> |
3 | #include <stdlib.h> | 3 | #include <stdlib.h> |
4 | #include <string.h> | 4 | #include <string.h> |
@@ -524,18 +524,14 @@ bio_zlib_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
524 | } | 524 | } |
525 | 525 | ||
526 | if (ibs != -1) { | 526 | if (ibs != -1) { |
527 | if (ctx->ibuf) { | 527 | free(ctx->ibuf); |
528 | free(ctx->ibuf); | 528 | ctx->ibuf = NULL; |
529 | ctx->ibuf = NULL; | ||
530 | } | ||
531 | ctx->ibufsize = ibs; | 529 | ctx->ibufsize = ibs; |
532 | } | 530 | } |
533 | 531 | ||
534 | if (obs != -1) { | 532 | if (obs != -1) { |
535 | if (ctx->obuf) { | 533 | free(ctx->obuf); |
536 | free(ctx->obuf); | 534 | ctx->obuf = NULL; |
537 | ctx->obuf = NULL; | ||
538 | } | ||
539 | ctx->obufsize = obs; | 535 | ctx->obufsize = obs; |
540 | } | 536 | } |
541 | ret = 1; | 537 | ret = 1; |