From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 87757 invoked by alias); 15 Jan 2019 19:55:16 -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 87746 invoked by uid 89); 15 Jan 2019 19:55:16 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:720, learn, day X-HELO: mailsec107.isp.belgacom.be Received: from mailsec107.isp.belgacom.be (HELO mailsec107.isp.belgacom.be) (195.238.20.103) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 15 Jan 2019 19:55:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=skynet.be; i=@skynet.be; q=dns/txt; s=securemail; t=1547582115; x=1579118115; h=message-id:subject:from:to:cc:date:in-reply-to: references:mime-version:content-transfer-encoding; bh=fxwDyvG+7z5QSQb15U6+JQOvkuYCLWg8IWMK+eT28/M=; b=Q7YQxf6IkP+uo1JpSP6PPcMk0XV2/tuxiEwvqffHzLIQdptgHTcddtk2 uhVkLg081WviVDbZek/2eMExWG40eA==; Received: from 184.205-67-87.adsl-dyn.isp.belgacom.be (HELO md) ([87.67.205.184]) by relay.skynet.be with ESMTP/TLS/AES256-GCM-SHA384; 15 Jan 2019 20:55:12 +0100 Message-ID: <1547582112.1726.5.camel@skynet.be> Subject: Re: [RFA] Fix leaks in macro definitions. From: Philippe Waroquiers To: Simon Marchi Cc: gdb-patches@sourceware.org Date: Tue, 15 Jan 2019 19:55:00 -0000 In-Reply-To: <63b6768fbedbe46b7a46f0d29f7b178c@polymtl.ca> References: <20190115055611.17967-1-philippe.waroquiers@skynet.be> <63b6768fbedbe46b7a46f0d29f7b178c@polymtl.ca> Content-Type: text/plain; charset="UTF-8" Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2019-01/txt/msg00356.txt.bz2 On Tue, 2019-01-15 at 11:50 -0500, Simon Marchi wrote: > > + gdb::unique_xmalloc_ptr name (extract_identifier (&exp, 0)); > > + if (name.get () == NULL) > > Nit, you don't have to use ".get ()" here. One day, I will really have to learn some C++ :). > > I think extract_identifier should return a gdb::unique_xmalloc_ptr. > This call site lower: > > argv[new_macro.argc] = extract_identifier (&exp, 1); > > can then use ".release ()". Yes, that looks like a cleaner approach. I will update the patch once the question about how to handle the splay tree leak is clarified i.e. fix in GDB, or (incompatible) fix in libiberty. (see other mail with Tom). Thanks Philippe