summaryrefslogtreecommitdiff
path: root/mjit.c
diff options
context:
space:
mode:
Diffstat (limited to 'mjit.c')
-rw-r--r--mjit.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/mjit.c b/mjit.c
index 473f60ccb4..eca995742b 100644
--- a/mjit.c
+++ b/mjit.c
@@ -334,7 +334,8 @@ form_args(int num, ...)
for (i = len = 0; i < num; i++) {
args = va_arg(argp, char **);
n = args_len(args);
- res = (char **)realloc(res, sizeof(char *) * (len + n + 1));
+ if ((res = (char **)realloc(res, sizeof(char *) * (len + n + 1))) == NULL)
+ return NULL;
MEMCPY(res + len, args, char *, n + 1);
len += n;
}
@@ -767,6 +768,8 @@ compile_c_to_so(const char *c_file, const char *so_file)
#ifdef _MSC_VER
solen = strlen(so_file);
files[0] = p = (char *)malloc(sizeof(char) * (rb_strlen_lit("-Fe") + solen + 1));
+ if (p == NULL)
+ return FALSE;
p = append_lit(p, "-Fe");
p = append_str2(p, so_file, solen);
*p = '\0';