rtcp_new: return failure if allocation of bi->ptr failed
[openssl.git] / 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;