summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorruki <[email protected]>2026-07-18 21:54:50 +0800
committerruki <[email protected]>2026-07-18 21:54:50 +0800
commitcfebf2a690e1a0ad2255f64eec5bec43eeac0049 (patch)
tree5659e0542966061f573bf5d948a664ec7605fa73
parent0641a99d357d99e96da49c22cb7d52be5f81c83f (diff)
fix mem leaks
-rw-r--r--core/src/xmake/binutils/bin2c.c4
-rw-r--r--core/src/xmake/binutils/coff/bin2coff.c4
-rw-r--r--core/src/xmake/binutils/elf/bin2elf.c6
-rw-r--r--core/src/xmake/binutils/macho/bin2macho.c4
-rw-r--r--core/src/xmake/binutils/readsyms.c4
5 files changed, 11 insertions, 11 deletions
diff --git a/core/src/xmake/binutils/bin2c.c b/core/src/xmake/binutils/bin2c.c
index b5054c55f..3c639d059 100644
--- a/core/src/xmake/binutils/bin2c.c
+++ b/core/src/xmake/binutils/bin2c.c
@@ -209,12 +209,12 @@ tb_int_t xm_binutils_bin2c(lua_State *lua) {
} while (0);
if (istream) {
- tb_stream_clos(istream);
+ tb_stream_exit(istream);
}
istream = tb_null;
if (ostream) {
- tb_stream_clos(ostream);
+ tb_stream_exit(ostream);
}
ostream = tb_null;
diff --git a/core/src/xmake/binutils/coff/bin2coff.c b/core/src/xmake/binutils/coff/bin2coff.c
index ceb984a5c..791d4e2ba 100644
--- a/core/src/xmake/binutils/coff/bin2coff.c
+++ b/core/src/xmake/binutils/coff/bin2coff.c
@@ -303,12 +303,12 @@ tb_int_t xm_binutils_bin2coff(lua_State *lua) {
} while (0);
if (istream) {
- tb_stream_clos(istream);
+ tb_stream_exit(istream);
}
istream = tb_null;
if (ostream) {
- tb_stream_clos(ostream);
+ tb_stream_exit(ostream);
}
ostream = tb_null;
diff --git a/core/src/xmake/binutils/elf/bin2elf.c b/core/src/xmake/binutils/elf/bin2elf.c
index ad580ba84..585ddc681 100644
--- a/core/src/xmake/binutils/elf/bin2elf.c
+++ b/core/src/xmake/binutils/elf/bin2elf.c
@@ -94,7 +94,7 @@ static tb_bool_t xm_binutils_bin2elf_read_refobj(tb_char_t const *refobj,
ok = tb_true;
} while (0);
- if (stream) tb_stream_clos(stream);
+ if (stream) tb_stream_exit(stream);
return ok;
}
@@ -791,11 +791,11 @@ tb_int_t xm_binutils_bin2elf(lua_State *lua) {
} while (0);
if (istream)
- tb_stream_clos(istream);
+ tb_stream_exit(istream);
istream = tb_null;
if (ostream)
- tb_stream_clos(ostream);
+ tb_stream_exit(ostream);
ostream = tb_null;
return ok ? 1 : 2;
diff --git a/core/src/xmake/binutils/macho/bin2macho.c b/core/src/xmake/binutils/macho/bin2macho.c
index 0b9dad0c2..c3c1c7a5c 100644
--- a/core/src/xmake/binutils/macho/bin2macho.c
+++ b/core/src/xmake/binutils/macho/bin2macho.c
@@ -606,12 +606,12 @@ tb_int_t xm_binutils_bin2macho(lua_State *lua) {
} while (0);
if (istream) {
- tb_stream_clos(istream);
+ tb_stream_exit(istream);
}
istream = tb_null;
if (ostream) {
- tb_stream_clos(ostream);
+ tb_stream_exit(ostream);
}
ostream = tb_null;
diff --git a/core/src/xmake/binutils/readsyms.c b/core/src/xmake/binutils/readsyms.c
index 2c119a538..cac501a69 100644
--- a/core/src/xmake/binutils/readsyms.c
+++ b/core/src/xmake/binutils/readsyms.c
@@ -82,7 +82,7 @@ tb_int_t xm_binutils_readsyms(lua_State *lua) {
lua_pushfstring(lua, "cannot detect file format");
break;
}
-
+
// create result list
lua_newtable(lua);
@@ -160,7 +160,7 @@ tb_int_t xm_binutils_readsyms(lua_State *lua) {
} while (0);
if (istream) {
- tb_stream_clos(istream);
+ tb_stream_exit(istream);
}
istream = tb_null;