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] Fix PR 12155, Memory leak in libobjc


I am applying this as obvious and based on Zack Weinberg saying all memory leaks are pre-approved from me.

2003-08-31 Adam Fedor <fedor@gnu.org>

        * 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);
 }


Thanks, Andrew Pinski


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