[前][次][番号順一覧][スレッド一覧]

ruby-changes:56529

From: Takashi <ko1@a...>
Date: Mon, 15 Jul 2019 09:36:19 +0900 (JST)
Subject: [ruby-changes:56529] Takashi Kokubun: 00a97d9412 (master): Always call va_end in form_args()

https://git.ruby-lang.org/ruby.git/commit/?id=00a97d9412

From 00a97d94122c256f4abe9375d19eaeb0f2eca201 Mon Sep 17 00:00:00 2001
From: Takashi Kokubun <takashikkbn@g...>
Date: Mon, 15 Jul 2019 09:35:45 +0900
Subject: Always call va_end in form_args()

This issue is detected by Coverity Scan.

diff --git a/mjit_worker.c b/mjit_worker.c
index c5df0b7..2ee9a53 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -528,7 +528,8 @@ form_args(int num, ...) https://github.com/ruby/ruby/blob/trunk/mjit_worker.c#L528
         n = args_len(args);
         if ((tmp = (char **)realloc(res, sizeof(char *) * (len + n + 1))) == NULL) {
             free(res);
-            return NULL;
+            res = NULL;
+            break;
         }
         res = tmp;
         MEMCPY(res + len, args, char *, n + 1);
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]