[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Libcdio-devel] memory leak in cdio_free()
From: |
Pete Batard |
Subject: |
[Libcdio-devel] memory leak in cdio_free() |
Date: |
Fri, 31 Oct 2014 18:49:32 +0000 |
User-agent: |
Mozilla/5.0 (Windows NT 6.3; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 |
Hi,
The following in memory.c [1] looks like an unfortunate typo:
if (p_memory != NULL) return;
The result is that cdio_free() currently leaks every block of memory it
should deallocate... :(
On a side note, free() is supposed to accept NULL as a pointer ([2] "If
ptr is NULL, no operation is performed."), so the check for NULL could
probably be avoided.
Regards,
/Pete
[1]
http://git.savannah.gnu.org/gitweb/?p=libcdio.git;a=blob;f=lib/driver/memory.c#l39
[2] http://linux.die.net/man/3/free
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Libcdio-devel] memory leak in cdio_free(),
Pete Batard <=