Skip to content

Commit 56fef61

Browse files
derskytheskotopes
andauthored
fix: Ensure proper closure of variadic function in mjs_array (#3798)
The changes ensure that the `va_end` function is always called after `c_vsnprintf` in `mjs_array.c` Co-authored-by: あく <[email protected]>
1 parent 01b402b commit 56fef61

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lib/mjs/mjs_array.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@
1919
static int v_sprintf_s(char* buf, size_t size, const char* fmt, ...) {
2020
size_t n;
2121
va_list ap;
22+
2223
va_start(ap, fmt);
2324
n = c_vsnprintf(buf, size, fmt, ap);
25+
va_end(ap);
26+
2427
if(n > size) {
2528
return size;
2629
}

0 commit comments

Comments
 (0)