diff options
author | Brian <[email protected]> | 2007-12-26 06:56:42 -0700 |
---|---|---|
committer | Brian <[email protected]> | 2008-01-01 10:21:21 -0700 |
commit | 573b4414b926bb86e9a1e8f3ffad64426aa4bda4 (patch) | |
tree | ba699929a6c2c5bdf056839b174a7f500fdfdb74 | |
parent | 171a9674c4caf32303a8d09ce48db18cde1d3e7e (diff) |
fix mem leak (free key)
-rw-r--r-- | src/mesa/main/ffvertex_prog.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/mesa/main/ffvertex_prog.c b/src/mesa/main/ffvertex_prog.c index 8fcb9e5b140..4a9a0cd975d 100644 --- a/src/mesa/main/ffvertex_prog.c +++ b/src/mesa/main/ffvertex_prog.c @@ -1,6 +1,6 @@ /************************************************************************** * - * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas. + * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. * * Permission is hereby granted, free of charge, to any person obtaining a @@ -1529,6 +1529,8 @@ _mesa_get_fixed_func_vertex_program(GLcontext *ctx) prog = (struct gl_vertex_program *) ctx->Driver.NewProgram(ctx, GL_VERTEX_PROGRAM_ARB, 0); + if (!prog) + return NULL; create_new_program( key, prog, ctx->Const.VertexProgram.MaxTemps ); @@ -1541,10 +1543,8 @@ _mesa_get_fixed_func_vertex_program(GLcontext *ctx) _mesa_program_cache_insert(ctx, ctx->VertexProgram.Cache, key, sizeof(*key), &prog->Base); } - else { - /* use cached program */ - _mesa_free(key); - } + + _mesa_free(key); return prog; } |