From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8152 invoked by alias); 11 Aug 2007 01:40:46 -0000 Received: (qmail 8087 invoked by uid 22791); 11 Aug 2007 01:40:46 -0000 X-Spam-Check-By: sourceware.org Received: from viper.snap.net.nz (HELO viper.snap.net.nz) (202.37.101.8) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 11 Aug 2007 01:40:40 +0000 Received: from kahikatea.snap.net.nz (160.60.255.123.dynamic.snap.net.nz [123.255.60.160]) by viper.snap.net.nz (Postfix) with ESMTP id C94BB3D9EA3; Sat, 11 Aug 2007 13:40:37 +1200 (NZST) Received: by kahikatea.snap.net.nz (Postfix, from userid 1000) id E0F7E8FC6D; Sat, 11 Aug 2007 13:40:34 +1200 (NZST) From: Nick Roberts MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <18109.5009.554826.719365@kahikatea.snap.net.nz> Date: Sat, 11 Aug 2007 01:40:00 -0000 To: msnyder@sonic.net Cc: gdb-patches@sourceware.org Subject: Re: [PATCH] varobj.c, value_of_root, (another) memory leak In-Reply-To: <16480.12.7.175.2.1186786910.squirrel@webmail.sonic.net> References: <16480.12.7.175.2.1186786910.squirrel@webmail.sonic.net> X-Mailer: VM 7.19 under Emacs 22.1.50.8 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: 2007-08/txt/msg00235.txt.bz2 > I'm not totally sure about this -- does the return value of var_get_type > need to be freed? If so, there are some other places in mi-cmd-var > where it isn't being. Yes, I think this is right but USE_SELECTED_FRAME is broken anyway. The ones in mi-cmd-var.c may be more important. Similar problems seem to occur with varobj_get_expression and varobj_get_value. Since the expression associated with a variable object doesn't change, I think c_name_of_variable could just be: static char * c_name_of_variable (struct varobj *var) { return var->name; } Are we close to release or branchpoint? If not let's do these things now. I also have a patch for editable/changeable properties of variable ojects which I'd like to resubmit for approval if a release is no longer imminent. -- Nick http://www.inet.net.nz/~nickrob > 2007-08-10 Michael Snyder > > * varobj.c (value_of_root): Memory leak. > > Index: varobj.c > =================================================================== > RCS file: /cvs/src/src/gdb/varobj.c,v > retrieving revision 1.90 > diff -p -r1.90 varobj.c > *** varobj.c 8 Aug 2007 21:46:37 -0000 1.90 > --- varobj.c 10 Aug 2007 22:58:51 -0000 > *************** value_of_root (struct varobj **var_handl > *** 1741,1746 **** > --- 1741,1748 ---- > var = *var_handle; > *type_changed = 1; > } > + xfree (old_type); > + xfree (new_type); > } > else > {