Fix comment in ssl_locl.h
[openssl.git] / ssl / pqueue.c
index ee64eb32ca94471126e87ab2005bf36b61dfd6d4..29804ec0274db8d8626cc1eb427d7e8ad2bb1712 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2005-2017 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2005-2018 The OpenSSL Project Authors. All Rights Reserved.
  *
  * Licensed under the OpenSSL license (the "License").  You may not use
  * this file except in compliance with the License.  You can obtain a copy
@@ -18,14 +18,15 @@ struct pqueue_st {
 pitem *pitem_new(unsigned char *prio64be, void *data)
 {
     pitem *item = OPENSSL_malloc(sizeof(*item));
-    if (item == NULL)
+
+    if (item == NULL) {
+        SSLerr(SSL_F_PITEM_NEW, ERR_R_MALLOC_FAILURE);
         return NULL;
+    }
 
     memcpy(item->priority, prio64be, sizeof(item->priority));
-
     item->data = data;
     item->next = NULL;
-
     return item;
 }
 
@@ -38,6 +39,9 @@ pqueue *pqueue_new()
 {
     pqueue *pq = OPENSSL_zalloc(sizeof(*pq));
 
+    if (pq == NULL)
+        SSLerr(SSL_F_PQUEUE_NEW, ERR_R_MALLOC_FAILURE);
+
     return pq;
 }