rtcp_new: return failure if allocation of bi->ptr failed

Signed-off-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
This commit is contained in:
Jonas Maebe 2013-12-08 17:16:12 +01:00 committed by Kurt Roeckx
parent 1c4b688cb4
commit 4e64f671c9

View 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;