summaryrefslogtreecommitdiff
path: root/random.c
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-01-07 14:05:43 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-01-07 14:05:43 +0000
commit0ff8d6346e19f5a57acfd3c979dad0891d79a729 (patch)
treec82786eaac6c474e607e565461b903787d6a8855 /random.c
parentddecb0423eee39938129061c35b22c1d788e9dab (diff)
* random.c (rand_init): use ALLOC_N instead of ALLOCA_N
by TAMURA Takashi. [ruby-dev:25426] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7746 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'random.c')
-rw-r--r--random.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/random.c b/random.c
index 6a4ed2d..658cce4 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;
}