summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2015-02-14 13:32:47 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2015-02-14 13:32:47 +0000
commitb46bdc18a5baee7871f4981da9998af4ac9bbc1c (patch)
tree575789f0683ed2d5abfdbc0c986ab99d5f6020ef
parentcdb3cd27e966329f19d8f19a436356999a7de29b (diff)
Spell NULL correctly, be explicit with NULL checks and it is also easier to
initialise during declaration and drop the else statement. ok doug@ miod@
-rw-r--r--lib/libssl/src/crypto/asn1/tasn_fre.c8
-rw-r--r--lib/libssl/src/crypto/asn1/tasn_new.c8
2 files changed, 6 insertions, 10 deletions
diff --git a/lib/libssl/src/crypto/asn1/tasn_fre.c b/lib/libssl/src/crypto/asn1/tasn_fre.c
index d8d55a536ca..36b668a7f9c 100644
--- a/lib/libssl/src/crypto/asn1/tasn_fre.c
+++ b/lib/libssl/src/crypto/asn1/tasn_fre.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tasn_fre.c,v 1.12 2014/07/10 12:24:25 tedu Exp $ */
+/* $OpenBSD: tasn_fre.c,v 1.13 2015/02/14 13:32:46 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000.
*/
@@ -86,16 +86,14 @@ asn1_item_combine_free(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine)
const ASN1_EXTERN_FUNCS *ef;
const ASN1_COMPAT_FUNCS *cf;
const ASN1_AUX *aux = it->funcs;
- ASN1_aux_cb *asn1_cb;
+ ASN1_aux_cb *asn1_cb = NULL;
int i;
if (pval == NULL || *pval == NULL)
return;
- if (aux && aux->asn1_cb)
+ if (aux != NULL && aux->asn1_cb != NULL)
asn1_cb = aux->asn1_cb;
- else
- asn1_cb = 0;
switch (it->itype) {
case ASN1_ITYPE_PRIMITIVE:
diff --git a/lib/libssl/src/crypto/asn1/tasn_new.c b/lib/libssl/src/crypto/asn1/tasn_new.c
index 88ee5c52248..cbc6bfc1d59 100644
--- a/lib/libssl/src/crypto/asn1/tasn_new.c
+++ b/lib/libssl/src/crypto/asn1/tasn_new.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tasn_new.c,v 1.11 2014/06/12 15:49:27 deraadt Exp $ */
+/* $OpenBSD: tasn_new.c,v 1.12 2015/02/14 13:32:46 jsing Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2000.
*/
@@ -94,14 +94,12 @@ asn1_item_ex_combine_new(ASN1_VALUE **pval, const ASN1_ITEM *it, int combine)
const ASN1_COMPAT_FUNCS *cf;
const ASN1_EXTERN_FUNCS *ef;
const ASN1_AUX *aux = it->funcs;
- ASN1_aux_cb *asn1_cb;
+ ASN1_aux_cb *asn1_cb = NULL;
ASN1_VALUE **pseqval;
int i;
- if (aux && aux->asn1_cb)
+ if (aux != NULL && aux->asn1_cb != NULL)
asn1_cb = aux->asn1_cb;
- else
- asn1_cb = 0;
if (!combine)
*pval = NULL;