Harmonize return values in dtls1_buffer_record
authorEmilia Kasper <emilia@openssl.org>
Wed, 4 Mar 2015 21:05:53 +0000 (13:05 -0800)
committerEmilia Kasper <emilia@openssl.org>
Tue, 10 Mar 2015 20:52:32 +0000 (13:52 -0700)
Ensure all malloc failures return -1.

Reported by Adam Langley (Google).

Reviewed-by: Matt Caswell <matt@openssl.org>
(cherry picked from commit 06c6a2b4a3a6e64303caa256398dd2dc16f9c35a)

ssl/d1_pkt.c

index bf96f609112e87910f187d25e83f41843b0eeecc..940ca692790271976366e9a34fad0687d588a475 100644 (file)
@@ -236,7 +236,7 @@ dtls1_buffer_record(SSL *s, record_pqueue *queue, unsigned char *priority)
             pitem_free(item);
 
         SSLerr(SSL_F_DTLS1_BUFFER_RECORD, ERR_R_INTERNAL_ERROR);
-        return (0);
+        return -1;
     }
 
     rdata->packet = s->packet;