speechd-discuss
[Top][All Lists]
Advanced

[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: Thu, 08 May 2014 09:57:43 +0200

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.

Greetings,
Frederik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: 
<http://lists.freebsoft.org/pipermail/speechd/attachments/20140508/88f61858/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Remove-xfree.patch
Type: text/x-patch
Size: 6922 bytes
Desc: not available
URL: 
<http://lists.freebsoft.org/pipermail/speechd/attachments/20140508/88f61858/attachment-0003.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Fix-memory-lead.patch
Type: text/x-patch
Size: 6556 bytes
Desc: not available
URL: 
<http://lists.freebsoft.org/pipermail/speechd/attachments/20140508/88f61858/attachment-0004.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-do-not-try-to-mitigate-OOM-issues.patch
Type: text/x-patch
Size: 2827 bytes
Desc: not available
URL: 
<http://lists.freebsoft.org/pipermail/speechd/attachments/20140508/88f61858/attachment-0005.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: This is a digitally signed message part.
URL: 
<http://lists.freebsoft.org/pipermail/speechd/attachments/20140508/88f61858/attachment-0001.pgp>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]