removed memory leak in string padding (issue #274)

This commit is contained in:
Fabrice Bellard 2025-03-27 14:43:25 +01:00
parent d20ffec831
commit e8cfe8fede

View File

@ -41928,7 +41928,7 @@ static JSValue js_string_pad(JSContext *ctx, JSValueConst this_val,
}
if (n > JS_STRING_LEN_MAX) {
JS_ThrowRangeError(ctx, "invalid string length");
goto fail2;
goto fail3;
}
if (string_buffer_init(ctx, b, n))
goto fail3;