From b1ffa191d2ac1ebf9ca3b014da2d7ced4a4cff2d Mon Sep 17 00:00:00 2001 From: blueloveTH Date: Thu, 15 Aug 2024 12:01:06 +0800 Subject: [PATCH] ... --- src/public/py_str.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/public/py_str.c b/src/public/py_str.c index 856f0b72..8ebce09c 100644 --- a/src/public/py_str.c +++ b/src/public/py_str.c @@ -272,7 +272,11 @@ static bool str_join(int argc, py_Ref argv) { bool first = true; while(true) { int res = py_next(py_peek(-1)); - if(res == -1) return false; + if(res == -1) { + c11_sbuf__dtor(&buf); + return false; + } + if(res == 0) break; if(!first) c11_sbuf__write_sv(&buf, self);