summaryrefslogtreecommitdiff
path: root/gc.c
diff options
context:
space:
mode:
Diffstat (limited to 'gc.c')
-rw-r--r--gc.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/gc.c b/gc.c
index 847062557f..d39d14d709 100644
--- a/gc.c
+++ b/gc.c
@@ -6003,9 +6003,8 @@ rb_gc_unprotect_logging(void *objptr, const char *filename, int line)
cnt++;
}
else {
- ptr = (char *)malloc(strlen(buff) + 1);
+ ptr = (strdup)(buff);
if (!ptr) rb_memerror();
- strcpy(ptr, buff);
}
st_insert(rgengc_unprotect_logging_table, (st_data_t)ptr, cnt);
}