[Mesa-dev] [PATCH] vbo: avoid leaking prim on vbo bind failure

Vinson Lee vlee at freedesktop.org
Sun May 1 04:51:26 UTC 2016


On Sat, Apr 30, 2016 at 7:29 PM, Ilia Mirkin <imirkin at alum.mit.edu> wrote:
> Spotted by Coverity
>
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
>  src/mesa/vbo/vbo_exec_array.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c
> index 51f41f3..870a096 100644
> --- a/src/mesa/vbo/vbo_exec_array.c
> +++ b/src/mesa/vbo/vbo_exec_array.c
> @@ -1138,8 +1138,10 @@ vbo_validated_multidrawelements(struct gl_context *ctx, GLenum mode,
>        return;
>     }
>
> -   if (!vbo_bind_arrays(ctx))
> +   if (!vbo_bind_arrays(ctx)) {
> +      free(prim);
>        return;
> +   }
>
>     min_index_ptr = (uintptr_t)indices[0];
>     max_index_ptr = 0;
> --
> 2.7.3
>

Reviewed-by: Vinson Lee <vlee at freedesktop.org>


More information about the mesa-dev mailing list