]> git.kaiwu.me - quickjs.git/commitdiff
removed memory leak in string padding (issue #274)
authorFabrice Bellard <fabrice@bellard.org>
Thu, 27 Mar 2025 13:43:25 +0000 (14:43 +0100)
committerFabrice Bellard <fabrice@bellard.org>
Thu, 27 Mar 2025 13:43:25 +0000 (14:43 +0100)
quickjs.c

index 38687cfa2b38aae504825564ec21782f37ecff38..946a743ae2273c221179eb06124a15a73f98fa09 100644 (file)
--- a/quickjs.c
+++ b/quickjs.c
@@ -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;