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 7dae485..d0cd1a9 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;