From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16016 invoked by alias); 9 Jan 2007 20:44:49 -0000 Received: (qmail 15108 invoked by uid 22791); 9 Jan 2007 20:44:17 -0000 X-Spam-Check-By: sourceware.org Received: from zigzag.lvk.cs.msu.su (HELO zigzag.lvk.cs.msu.su) (158.250.17.23) by sourceware.org (qpsmtpd/0.31) with ESMTP; Tue, 09 Jan 2007 20:44:08 +0000 Received: from Debian-exim by zigzag.lvk.cs.msu.su with spam-scanned (Exim 4.50) id 1H4Np8-0006Ix-TE for gdb-patches@sources.redhat.com; Tue, 09 Jan 2007 23:44:04 +0300 Received: from localhost ([127.0.0.1] helo=ip6-localhost) by zigzag.lvk.cs.msu.su with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA:32) (Exim 4.50) id 1H4Np8-0006It-Ob for gdb-patches@sources.redhat.com; Tue, 09 Jan 2007 23:43:58 +0300 From: Vladimir Prus To: gdb-patches@sources.redhat.com Subject: Fix varobj_update memleak Date: Tue, 09 Jan 2007 20:44:00 -0000 User-Agent: KMail/1.9.1 MIME-Version: 1.0 Content-Type: Multipart/Mixed; boundary="Boundary-00=_g5/oF7E32Uj9NdO" Message-Id: <200701092343.12106.ghost@cs.msu.su> 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-01/txt/msg00264.txt.bz2 --Boundary-00=_g5/oF7E32Uj9NdO Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Content-Disposition: inline Content-length: 154 I suppose I wrote two much C++ code, where destructors just work. OK? - Volodya Fix memory leak. * varobj.c (varobj_update): Free temporary vectors. --Boundary-00=_g5/oF7E32Uj9NdO Content-Type: text/x-diff; charset="us-ascii"; name="varobj_update_memleak__gdb_mainline.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="varobj_update_memleak__gdb_mainline.diff" Content-length: 334 --- gdb/varobj.c (/mirrors/gdb_mainline) (revision 3134) +++ gdb/varobj.c (/patches/gdb/varobj_update_memleak/gdb_mainline) (revision 3134) @@ -1143,6 +1143,9 @@ varobj_update (struct varobj **varp, str } *cv = 0; + VEC_free (varobj_p, stack); + VEC_free (varobj_p, result); + if (type_changed) return -2; else --Boundary-00=_g5/oF7E32Uj9NdO--