[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Memory leaks in C API
From: |
Frederik Gladhorn |
Subject: |
Memory leaks in C API |
Date: |
Tue, 13 May 2014 15:23:40 +0200 |
Tirsdag 13. mai 2014 15.53.05 skrev Luke Yelavich:
> On Thu, May 08, 2014 at 05:57:43PM EST, Frederik Gladhorn wrote:
> > Hi,
> >
> > I was just playing with the C API of speech dispatcher.
> >
> > The first patch removes xfree which doesn't make much sense, it did a
> > nullptr check before calling free.
> > The second patch fixes a few memory leaks. Note that it adds a function to
> > actually free a connection, that was pretty hard work so far.
> >
> > The third patch I leave up to your judgement, it simplifies the code by
> > also getting rid of xmalloc which is malloc with a warning and exit if
> > we're out of memory. Imho there is no point of handling that and it
> > clutters the code. It's quite unlikely that the tiny C client API can do
> > anything in case of OOM.
>
> I've applied all your patches, thanks for your work.
Thanks, here is another patch that fixes another (less relevant) memory leak,
the mutexes are getting allocated but not freed. This cleanup makes it easier
to use valgrind to get meaningful output.
Cheers,
Frederik
> _______________________________________________
> Speechd mailing list
> Speechd at lists.freebsoft.org
> http://lists.freebsoft.org/mailman/listinfo/speechd
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Free-mutexes.patch
Type: text/x-patch
Size: 1027 bytes
Desc: not available
URL:
<http://lists.freebsoft.org/pipermail/speechd/attachments/20140513/84d7886c/attachment.bin>