From: Brian Date: Thu, 19 Apr 2007 21:28:42 +0000 (-0600) Subject: fix memleak in slang_operation_insert() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f2346498aacdfc3e574fed43e0fe13ad3f8e2a2d;p=mesa.git fix memleak in slang_operation_insert() --- diff --git a/src/mesa/shader/slang/slang_compile_operation.c b/src/mesa/shader/slang/slang_compile_operation.c index 410d215a8d4..5d80bc77c64 100644 --- a/src/mesa/shader/slang/slang_compile_operation.c +++ b/src/mesa/shader/slang/slang_compile_operation.c @@ -205,6 +205,8 @@ slang_operation_insert(GLuint *numChildren, slang_operation **children, *children = NULL; return NULL; } + if (*children) + _mesa_free(*children); *children = ops; (*numChildren)++; return newOp;