From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13948 invoked by alias); 14 Aug 2012 12:45:06 -0000 Received: (qmail 13880 invoked by uid 22791); 14 Aug 2012 12:45:05 -0000 X-SWARE-Spam-Status: No, hits=-1.4 required=5.0 tests=AWL,BAYES_00,SPF_FAIL X-Spam-Check-By: sourceware.org Received: from gbenson.demon.co.uk (HELO gbenson.demon.co.uk) (80.177.220.214) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Aug 2012 12:44:44 +0000 Date: Tue, 14 Aug 2012 12:45:00 -0000 From: Gary Benson To: gdb-patches@sourceware.org Subject: [RFA] Fix memory leak in solib-svr4.c Message-ID: <20120814124441.GA19388@redhat.com> Mail-Followup-To: gdb-patches@sourceware.org MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="82I3+IH0IqGh5yIs" Content-Disposition: inline X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-08/txt/msg00385.txt.bz2 --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 234 Hi all, I found a memory leak in solib-svr4.c: svr4_free_library_list uses svr4_free_so, which frees the inner parts of the so_list but not the so_list itself. This patch fixes. Ok to commit? Thanks, Gary -- http://gbenson.net/ --82I3+IH0IqGh5yIs Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=patch Content-length: 533 Organization: Red Hat UK Ltd, 64 Baker Street, 4th Floor, W1U 7DF, UK. Registered in England and Wales (3798903) 2012-08-14 Gary Benson * solib-svr4.c (svr4_free_library_list): Use free_so. diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 76bd872..2f4a345 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -980,7 +980,7 @@ svr4_free_library_list (void *p_list) { struct so_list *next = list->next; - svr4_free_so (list); + free_so (list); list = next; } } --82I3+IH0IqGh5yIs--