Remove unnecessary NULL checks, part 1.
First batch of the alphabet.
Change-Id: If4e60f4fbb69e04eb4b70aa1b2240e329251bfa5
Reviewed-on: https://boringssl-review.googlesource.com/4514
Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/bn/ctx.c b/crypto/bn/ctx.c
index e3a5c92..0578376 100644
--- a/crypto/bn/ctx.c
+++ b/crypto/bn/ctx.c
@@ -205,9 +205,7 @@
}
static void BN_STACK_finish(BN_STACK *st) {
- if (st->size) {
- OPENSSL_free(st->indexes);
- }
+ OPENSSL_free(st->indexes);
}
static int BN_STACK_push(BN_STACK *st, unsigned int idx) {
@@ -222,9 +220,7 @@
if (st->depth) {
memcpy(newitems, st->indexes, st->depth * sizeof(unsigned int));
}
- if (st->size) {
- OPENSSL_free(st->indexes);
- }
+ OPENSSL_free(st->indexes);
st->indexes = newitems;
st->size = newsize;
}