orcbytecode: Don't replace program name without freeing the old name if any
authorSebastian Dröge <sebastian@centricular.com>
Tue, 15 Apr 2014 08:24:56 +0000 (10:24 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 15 Apr 2014 08:24:56 +0000 (10:24 +0200)
orc/orcbytecode.c

index 49339b3..8e7bad4 100644 (file)
@@ -420,6 +420,9 @@ orc_bytecode_parse_function (OrcProgram *program, const orc_uint8 *bytecode)
           program->constant_m = orc_bytecode_parse_get_int (parse);
           break;
         case ORC_BC_SET_NAME:
+          if (program->name) {
+            free (program->name);
+          }
           program->name = orc_bytecode_parse_get_string (parse);
           break;
         case ORC_BC_SET_BACKUP_FUNCTION: