From a71edf3ba275b946224b5bcded0a8ecfce1855c0 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Fri, 30 Oct 2015 10:05:53 +0000 Subject: 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 --- ssl/d1_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ssl/d1_lib.c') 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); -- cgit v1.2.3