From c4ec5d7da4b40b4da760669d2b374e9c92742f7b Mon Sep 17 00:00:00 2001 From: jsing Date: Wed, 7 Feb 2018 08:57:25 +0000 Subject: [PATCH] Restore a check before BN_free() that needs to exist and write it such that the intent is more obvious. --- usr.bin/openssl/apps.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/usr.bin/openssl/apps.c b/usr.bin/openssl/apps.c index 22b6b2838bf..90baf65a9f5 100644 --- a/usr.bin/openssl/apps.c +++ b/usr.bin/openssl/apps.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apps.c,v 1.46 2018/02/07 05:47:55 jsing Exp $ */ +/* $OpenBSD: apps.c,v 1.47 2018/02/07 08:57:25 jsing Exp $ */ /* * Copyright (c) 2014 Joel Sing * @@ -1425,7 +1425,8 @@ rand_serial(BIGNUM *b, ASN1_INTEGER *ai) ret = 1; error: - BN_free(btmp); + if (b != btmp) + BN_free(btmp); return ret; } -- 2.20.1