rtcp_new: return failure if allocation of bi->ptr failed
authorJonas Maebe <jonas.maebe@elis.ugent.be>
Sun, 8 Dec 2013 16:16:12 +0000 (17:16 +0100)
committerKurt Roeckx <kurt@roeckx.be>
Fri, 15 Aug 2014 20:38:05 +0000 (22:38 +0200)
Signed-off-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/bio/bss_rtcp.c

index 7dae4855640645615f03c533250a2bb9b6f96b6b..d0cd1a96802eb4f188025d7f9914ce434fbc5b9f 100644 (file)
@@ -157,6 +157,8 @@ static int rtcp_new(BIO *bi)
        bi->num=0;
        bi->flags = 0;
        bi->ptr=OPENSSL_malloc(sizeof(struct rpc_ctx));
+       if (bi->ptr == NULL)
+               return(0);
        ctx = (struct rpc_ctx *) bi->ptr;
        ctx->filled = 0;
        ctx->pos = 0;