From b7eed19efec0cdaca42cabbc6f9fadcb892aee81 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 21 Feb 2010 15:10:50 -0800 Subject: [PATCH] st/mesa: Fix memory leak on out-of-memory error path. --- src/mesa/state_tracker/st_program.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index 7ce3938904b..7f8677d400c 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -205,8 +205,10 @@ st_translate_vertex_program(struct st_context *st, unsigned num_outputs; ureg = ureg_create( TGSI_PROCESSOR_VERTEX ); - if (ureg == NULL) + if (ureg == NULL) { + FREE(vpv); return NULL; + } vpv->num_inputs = stvp->num_inputs; num_outputs = stvp->num_outputs; -- 2.30.2