From 7d0020111445248f91aa35e396dcd67d3fe80bc4 Mon Sep 17 00:00:00 2001 From: kramm Date: Mon, 24 Nov 2008 16:12:15 +0000 Subject: [PATCH] fixed two more mem leaks --- lib/as3/abc.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/as3/abc.c b/lib/as3/abc.c index d03977d..70e67ac 100644 --- a/lib/as3/abc.c +++ b/lib/as3/abc.c @@ -309,13 +309,15 @@ static void dump_traits(FILE*fo, const char*prefix, trait_list_t*traits, abc_fil static void dump_method(FILE*fo, const char*prefix, const char*type, const char*name, abc_method_t*m, abc_file_t*file) { - const char*return_type = "void"; + char*return_type = 0; if(m->return_type) return_type = multiname_to_string(m->return_type); - + else + return_type = strdup("void"); char*paramstr = params_to_string(m->parameters); - fprintf(fo, "%s%s %s %s=%s %s\n", prefix, type, return_type, name, m->name, paramstr); + free(paramstr);paramstr=0; + free(return_type);return_type=0; abc_method_body_t*c = m->body; if(!c) { @@ -651,7 +653,7 @@ void* swf_ReadABC(TAG*tag) DEBUG printf("method %d) %s flags=%02x\n", t, params_to_string(m->parameters), m->flags); if(m->flags&0x08) { - /* optional parameters */ + /* TODO optional parameters */ int num = swf_GetU30(tag); int s; for(s=0;s