summaryrefslogtreecommitdiffstats
path: root/ssl/d1_lib.c
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2015-10-30 10:05:53 +0000
committerMatt Caswell <matt@openssl.org>2015-11-09 22:48:41 +0000
commita71edf3ba275b946224b5bcded0a8ecfce1855c0 (patch)
tree85257ad90882fc4d8d8f73cd91a03b7cc476b9d2 /ssl/d1_lib.c
parent3457e7a087a643cb65d67d9d72ec5983a02f5dfe (diff)
Standardise our style for checking malloc failures
if we have a malloc |x = OPENSSL_malloc(...)| sometimes we check |x| for NULL and sometimes we treat it as a boolean |if(!x) ...|. Standardise the approach in libssl. Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Diffstat (limited to 'ssl/d1_lib.c')
-rw-r--r--ssl/d1_lib.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ssl/d1_lib.c b/ssl/d1_lib.c
index b865ad42b2..6e70c56ce7 100644
--- a/ssl/d1_lib.c
+++ b/ssl/d1_lib.c
@@ -155,7 +155,7 @@ int dtls1_new(SSL *s)
d1->link_mtu = 0;
d1->mtu = 0;
- if (!d1->buffered_messages || !d1->sent_messages) {
+ if (d1->buffered_messages == NULL || d1->sent_messages == NULL) {
pqueue_free(d1->buffered_messages);
pqueue_free(d1->sent_messages);
OPENSSL_free(d1);