summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--random.c4
2 files changed, 7 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b98e67d650..5b0370de1d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+Fri Jan 7 21:12:29 2005 TAMURA Takashi <sheepman@tcn.zaq.ne.jp>
+
+ * random.c (rand_init): use ALLOC_N instead of ALLOCA_N
+ [ruby-dev:25426]
+
Fri Jan 7 18:03:35 2005 Tanaka Akira <akr@m17n.org>
* gc.c (mark_locations_array): avoid core dump with -O3.
diff --git a/random.c b/random.c
index 6a4ed2d286..658cce4b92 100644
--- a/random.c
+++ b/random.c
@@ -216,7 +216,7 @@ rand_init(vseed)
rb_obj_classname(vseed));
}
len = (len + 3) / 4; /* number of 32bit words */
- buf = ALLOCA_N(long, len); /* allocate longs for init_by_array */
+ buf = ALLOC_N(long, len); /* allocate longs for init_by_array */
memset(buf, 0, len * sizeof(long));
if (FIXNUM_P(seed)) {
buf[0] = FIX2ULONG(seed) & 0xffffffff;
@@ -248,7 +248,7 @@ rand_init(vseed)
first = 0;
old = saved_seed;
saved_seed = seed;
-
+ free(buf);
return old;
}