summaryrefslogtreecommitdiffstats
path: root/src/crypto/bn/ctx.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/crypto/bn/ctx.c')
-rw-r--r--src/crypto/bn/ctx.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/crypto/bn/ctx.c b/src/crypto/bn/ctx.c
index e54007b..0578376 100644
--- a/src/crypto/bn/ctx.c
+++ b/src/crypto/bn/ctx.c
@@ -205,14 +205,12 @@ static void BN_STACK_init(BN_STACK *st) {
}
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) {
- if (st->depth == st->size)
- /* Need to expand */
- {
+ if (st->depth == st->size) {
+ /* Need to expand */
unsigned int newsize =
(st->size ? (st->size * 3 / 2) : BN_CTX_START_FRAMES);
unsigned int *newitems = OPENSSL_malloc(newsize * sizeof(unsigned int));
@@ -222,9 +220,7 @@ static int BN_STACK_push(BN_STACK *st, unsigned int idx) {
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;
}