[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Memory leaks in C API
From: |
Luke Yelavich |
Subject: |
Memory leaks in C API |
Date: |
Tue, 13 May 2014 15:53:05 +1000 |
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.
Luke