From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 126645 invoked by alias); 10 Oct 2018 14:11:48 -0000 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 Received: (qmail 126617 invoked by uid 89); 10 Oct 2018 14:11:47 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=palves, Hx-languages-length:849, emails, his X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 10 Oct 2018 14:11:45 +0000 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 27DCE3001740 for ; Wed, 10 Oct 2018 14:11:44 +0000 (UTC) Received: from [127.0.0.1] (ovpn04.gateway.prod.ext.ams2.redhat.com [10.39.146.4]) by smtp.corp.redhat.com (Postfix) with ESMTP id 82E2484773; Wed, 10 Oct 2018 14:11:43 +0000 (UTC) Subject: Re: [PATCH] Fix resource leak found by Coverity To: Gary Benson , gdb-patches@sourceware.org References: <1539179578-32250-1-git-send-email-gbenson@redhat.com> From: Pedro Alves Message-ID: Date: Wed, 10 Oct 2018 14:11:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <1539179578-32250-1-git-send-email-gbenson@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2018-10/txt/msg00258.txt.bz2 Please use some more descriptive subject in these emails/commits, otherwise we're going to end up with dozens of indistinct "Fix resource leak found by Coverity" patches/emails. :-) E.g., "Fix leak in valops.c:find_oload_champ" or some such. As for the patch itself, I think that we'd still be leaking bv->rank, right? Not just here, but in the callers of rank_function as well? I have a patch from last year here that converts the badness vector to a C++ std::vector: https://github.com/palves/gdb/commits/palves/badness_vector See top two commits. I guess a better approach would be to get that in instead. Simon had a badness_vector C++ification patch too, though his was different. ISTR that I prefer my approach, but I won't be surprised if Simon preferred his. :-) Thanks, Pedro Alves