Module: Demos Branch: master Commit: 510fa61bfb20f087590b6bf72d4d84ef87188532 URL: http://cgit.freedesktop.org/mesa/demos/commit/?id=510fa61bfb20f087590b6bf72d4d84ef87188532
Author: Vinson Lee <[email protected]> Date: Thu Dec 23 09:03:10 2010 -0800 glxswapcontrol: Fix memory leak on error path. --- src/xdemos/glxswapcontrol.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-) diff --git a/src/xdemos/glxswapcontrol.c b/src/xdemos/glxswapcontrol.c index cd60d46..7c4b413 100644 --- a/src/xdemos/glxswapcontrol.c +++ b/src/xdemos/glxswapcontrol.c @@ -707,6 +707,14 @@ make_extension_table( const char * string ) string_tab[ idx ] = malloc( sizeof( char ) * (i + 1) ); if ( string_tab[ idx ] == NULL ) { + unsigned j = 0; + + for ( j = 0; j < idx; j++ ) { + free( string_tab[j] ); + } + + free( string_tab ); + return; } _______________________________________________ mesa-commit mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/mesa-commit
