This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH]: Memory leak in libobjc


This patch fixes a minor memory leak in libobjc.
(See PR libobjc/12155)

Boostrapped and tested on i686-pc-linux-gnu with mainline:
gcc (GCC) 3.4 20031016 (experimental)
No regressions.

2003-10-16 Adam Fedor <fedor@gnu.org>

	PR libobjc/12155
	* selector.c (__objc_register_instance_methods_to_class): Free
	new_list if not used.

Index: selector.c
===================================================================
RCS file: /cvsroot/gnustep/gnustep/dev-libs/libobjc/selector.c,v
retrieving revision 1.3
diff -u -p -r1.3 selector.c
--- selector.c	23 Feb 2003 03:48:41 -0000	1.3
+++ selector.c	1 Sep 2003 03:36:06 -0000
@@ -148,6 +148,8 @@ void __objc_register_instance_methods_to
       new_list->method_next = class->class_pointer->methods;
       class->class_pointer->methods = new_list;
     }
+  else
+    objc_free(new_list);

     __objc_update_dispatch_table_for_class (class->class_pointer);
 }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]