mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* ext/syck/syck.c (syck_free_parser): fix memory leak by
YAML::Syck.compile. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9de7bcff88
commit
e4416992d8
2 changed files with 22 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Wed Jul 30 21:08:06 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* ext/syck/syck.c (syck_free_parser): fix memory leak by
|
||||
YAML::Syck.compile.
|
||||
|
||||
Thu Jul 31 22:17:35 2008 Yusuke Endoh <mame@tsg.ne.jp>
|
||||
|
||||
* ext/bigdecimal/bigdecimal.c (VpMult): prevent memory leak.
|
||||
|
|
|
@ -229,6 +229,22 @@ syck_st_free( SyckParser *p )
|
|||
}
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
long hash;
|
||||
char *buffer;
|
||||
long length;
|
||||
long remaining;
|
||||
int printed;
|
||||
} bytestring_t;
|
||||
|
||||
int
|
||||
syck_st_free_syms( void *key, bytestring_t *sav, void *dummy )
|
||||
{
|
||||
S_FREE(sav->buffer);
|
||||
S_FREE(sav);
|
||||
return ST_CONTINUE;
|
||||
}
|
||||
|
||||
void
|
||||
syck_free_parser( SyckParser *p )
|
||||
{
|
||||
|
@ -237,6 +253,7 @@ syck_free_parser( SyckParser *p )
|
|||
*/
|
||||
if ( p->syms != NULL )
|
||||
{
|
||||
st_foreach( p->syms, syck_st_free_syms, 0 );
|
||||
st_free_table( p->syms );
|
||||
p->syms = NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue