X-Authentication-Warning: delorie.com: mail set sender to geda-user-bounces using -f X-Recipient: geda-user AT delorie DOT com Date: Sat, 12 Dec 2020 13:05:46 +0100 (CET) From: Roland Lutz To: "Glenn (glimrick AT epilitimus DOT com) [via geda-user AT delorie DOT com]" Subject: Re: [geda-user] Memory leak patches (was: SAB processing patches) In-Reply-To: <63273f86-b0fd-8835-a13e-6ab408f06dfc@epilitimus.com> Message-ID: References: <20201130220505 DOT 0AE4282C54FD AT turkos DOT aspodata DOT se> <7c75ed03-456c-b408-8b50-0448f6b3a04f AT epilitimus DOT com> <1b2c64b3-6a36-c1f3-dd54-bb583c6bea17 AT epilitimus DOT com> <475f980e-fddd-60d1-9a02-a5bc5fb5805b AT epilitimus DOT com> <8706c896-e01a-9e6e-2bab-fe3607064093 AT epilitimus DOT com> <63273f86-b0fd-8835-a13e-6ab408f06dfc AT epilitimus DOT com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Reply-To: geda-user AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: geda-user AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Fri, 11 Dec 2020, Glenn (glimrick AT epilitimus DOT com) [via geda-user AT delorie DOT com] wrote: > I looked at this again. While I am sure you are correct about > g_object_data valgrind lists the string as definitely lost so you need > to find another place to free it once you are done with it. Yes, the string is lost; it is allocated and its pointer stored in the general-purpose "data" field of the widget. The proper way to free it would be to use g_object_set_data_full with a GDestroyNotify callback (probably just g_free).