diff options
author | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-04-26 23:24:46 +0000 |
---|---|---|
committer | why <why@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-04-26 23:24:46 +0000 |
commit | a7524e343c1db6c3d336e0223029a1392fa080e2 (patch) | |
tree | 69a30e0e5d0cbe200622e7885f07f19cf27d56c8 /ext/syck/node.c | |
parent | 10b598499b61d2c95a417f145e4cc70d96aeee71 (diff) |
* lib/yaml/rubytypes.rb: passing Range tests.
* ext/syck/syck.h: version 0.44.
* ext/syck/gram.c: transfers no longer open an indentation.
fixed transfers which precede blocks.
* ext/syck/token.c: ditto.
* ext/syck/syck.c: fixed segfault if an anchor has been released already.
* ext/syck/node.c (syck_free_members): organized order of free'd nodes.
* ext/syck/rubyext.c (syck_emitter_write_m): test for proper string with
StringValue.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6221 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/syck/node.c')
-rw-r--r-- | ext/syck/node.c | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/ext/syck/node.c b/ext/syck/node.c index f999700554..99bb07bc74 100644 --- a/ext/syck/node.c +++ b/ext/syck/node.c @@ -297,27 +297,38 @@ syck_seq_read( SyckNode *seq, long idx ) void syck_free_members( SyckNode *n ) { + if ( n == NULL ) return; + switch ( n->kind ) { case syck_str_kind: - if ( n->data.str->ptr != NULL ) + if ( n->data.str != NULL ) { S_FREE( n->data.str->ptr ); n->data.str->ptr = NULL; n->data.str->len = 0; S_FREE( n->data.str ); + n->data.str = NULL; } break; case syck_seq_kind: - S_FREE( n->data.list->items ); - S_FREE( n->data.list ); + if ( n->data.list != NULL ) + { + S_FREE( n->data.list->items ); + S_FREE( n->data.list ); + n->data.list = NULL; + } break; case syck_map_kind: - S_FREE( n->data.pairs->keys ); - S_FREE( n->data.pairs->values ); - S_FREE( n->data.pairs ); + if ( n->data.pairs != NULL ) + { + S_FREE( n->data.pairs->keys ); + S_FREE( n->data.pairs->values ); + S_FREE( n->data.pairs ); + n->data.pairs = NULL; + } break; } } |