fix memleak in slang_operation_insert()
authorBrian <brian@yutani.localnet.net>
Thu, 19 Apr 2007 21:28:42 +0000 (15:28 -0600)
committerBrian <brian@yutani.localnet.net>
Sat, 21 Apr 2007 16:05:05 +0000 (10:05 -0600)
src/mesa/shader/slang/slang_compile_operation.c

index 410d215a8d4bc510f3391d3fd96f05f7e02707e4..5d80bc77c64fea2f1128aa08eea015a863fa4086 100644 (file)
@@ -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;