This is the mail archive of the gcc-bugs@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]

[Bug libobjc/12155] New: Memory leak in libobjc(selector.c)


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=12155

           Summary: Memory leak in libobjc(selector.c)
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: libobjc
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: fedor at gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: any
  GCC host triplet: any
GCC target triplet: any

This patch fixes a minor memory leak in libobjc:

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


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