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 19:18:18 +0000 (12:18 -0700)
Ensure all malloc failures return -1.

Reported by Adam Langley (Google).

Reviewed-by: Matt Caswell <matt@openssl.org>
ssl/d1_pkt.c

index b1d9156de7b04b6ff244d54ecede96a20a09b6f2..4dbd694442c911e496e3597b1e53c7b6c9802682 100644 (file)
@@ -231,7 +231,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;