git.ucc.asn.au
/
tpg
/
acess2.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
SpiderScript - More changes, cleaning up
[tpg/acess2.git]
/
Usermode
/
Libraries
/
libspiderscript.so_src
/
bytecode_makefile.c
diff --git
a/Usermode/Libraries/libspiderscript.so_src/bytecode_makefile.c
b/Usermode/Libraries/libspiderscript.so_src/bytecode_makefile.c
index
a4c9b71
..
033f8d7
100644
(file)
--- a/
Usermode/Libraries/libspiderscript.so_src/bytecode_makefile.c
+++ b/
Usermode/Libraries/libspiderscript.so_src/bytecode_makefile.c
@@
-94,6
+94,7
@@
int Bytecode_ConvertScript(tSpiderScript *Script, const char *DestFile)
code = Bytecode_SerialiseFunction(bc_fcn, &len, &strings);
Bytecode_DeleteFunction(bc_fcn);
fwrite(code, len, 1, fp);
code = Bytecode_SerialiseFunction(bc_fcn, &len, &strings);
Bytecode_DeleteFunction(bc_fcn);
fwrite(code, len, 1, fp);
+ free(code);
}
// String table
}
// String table
@@
-109,11
+110,16
@@
int Bytecode_ConvertScript(tSpiderScript *Script, const char *DestFile)
string_offset += str->Length + 1;
}
// Data
string_offset += str->Length + 1;
}
// Data
- for(str = strings.Head; str;
str = str->Next
)
+ for(str = strings.Head; str;)
{
{
+ tString *nextstr = str->Next;
fwrite(str->Data, str->Length, 1, fp);
_put8(0);
fwrite(str->Data, str->Length, 1, fp);
_put8(0);
+ free(str);
+ str = nextstr;
}
}
+ strings.Head = NULL;
+ strings.Tail = NULL;
}
// Fix header
}
// Fix header
@@
-122,6
+128,8
@@
int Bytecode_ConvertScript(tSpiderScript *Script, const char *DestFile)
_put32(strings.Count);
_put32(strtab_ofs);
_put32(strings.Count);
_put32(strtab_ofs);
+ fclose(fp);
+
return 0;
}
return 0;
}
UCC
git Repository :: git.ucc.asn.au