summaryrefslogtreecommitdiff
path: root/ext/syck
diff options
context:
space:
mode:
authorocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-01-10 04:54:10 +0000
committerocean <ocean@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2006-01-10 04:54:10 +0000
commit37bafa322abf7f6fe9dd39c18c8c11a973d7abd6 (patch)
treec3174ddc3d13e29d461343225a0206fd850fe322 /ext/syck
parent399d08df016ed7139e45bba96c99b14094fb6326 (diff)
Sorry, commit miss.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9819 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/syck')
-rw-r--r--ext/syck/rubyext.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/ext/syck/rubyext.c b/ext/syck/rubyext.c
index a4717e4..14dbd9c 100644
--- a/ext/syck/rubyext.c
+++ b/ext/syck/rubyext.c
@@ -115,14 +115,14 @@ rb_syck_compile(self, port)
oid = syck_parse( parser );
syck_lookup_sym( parser, oid, (char **)&sav );
- ret = S_ALLOC_N( char, strlen( sav->buffer ) + 3 );
+ ret = S_ALLOCA_N( char, strlen( sav->buffer ) + 3 );
ret[0] = '\0';
strcat( ret, "D\n" );
strcat( ret, sav->buffer );
syck_free_parser( parser );
- bc = rb_str_new2( ret ); S_FREE( ret );
+ bc = rb_str_new2( ret );
if ( taint ) OBJ_TAINT( bc );
return bc;
}
@@ -1043,12 +1043,11 @@ syck_set_ivars( vars, obj )
VALUE ivname = rb_ary_entry( vars, 0 );
char *ivn;
StringValue( ivname );
- ivn = S_ALLOC_N( char, RSTRING(ivname)->len + 2 );
+ ivn = S_ALLOCA_N( char, RSTRING(ivname)->len + 2 );
ivn[0] = '@';
ivn[1] = '\0';
strncat( ivn, RSTRING(ivname)->ptr, RSTRING(ivname)->len );
rb_iv_set( obj, ivn, rb_ary_entry( vars, 1 ) );
- S_FREE( ivn );
return Qnil;
}