From patchwork Tue Jan 17 01:39:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pedro Alves X-Patchwork-Id: 18921 Received: (qmail 100284 invoked by alias); 17 Jan 2017 01:39:13 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 100256 invoked by uid 89); 17 Jan 2017 01:39:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-5.1 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=sk:PyObjec, sk:pyobjec, sk:gdbpy_t, sk:30dfb86 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; Tue, 17 Jan 2017 01:39:11 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 58700C04B302 for ; Tue, 17 Jan 2017 01:39:11 +0000 (UTC) Received: from cascais.lan (ovpn04.gateway.prod.ext.phx2.redhat.com [10.5.9.4]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v0H1d8jl024262 for ; Mon, 16 Jan 2017 20:39:10 -0500 From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 2/5] gdb/varobj.c: Fix leak Date: Tue, 17 Jan 2017 01:39:04 +0000 Message-Id: <1484617147-2506-3-git-send-email-palves@redhat.com> In-Reply-To: <1484617147-2506-1-git-send-email-palves@redhat.com> References: <1484617147-2506-1-git-send-email-palves@redhat.com> Whoops, this function returns a std::string. gdb/ChangeLog: 2017-01-17 Pedro Alves * varobj.c (varobj_value_get_print_value): Remove xstrdup call. --- gdb/varobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gdb/varobj.c b/gdb/varobj.c index 30dfb86..bcca6c6 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -2432,7 +2432,7 @@ varobj_value_get_print_value (struct value *value, if (dynamic_varobj_has_child_method (var)) { do_cleanups (old_chain); - return xstrdup ("{...}"); + return "{...}"; } if (PyObject_HasAttr (value_formatter, gdbpy_to_string_cst))