selinux/libsepol
Nicolas Iooss 2dc6406a30
libsepol: do not leak memory if list_prepend fails
When list_prepend() returns an error, it always means it failed to
allocate some memory and does not hold any reference to its argument
data. This argument needs to be freed by the caller in order to prevent
a memory leak.

While reviewing list_prepend() callers, I spend quite some time
understanding why typealiases_gather_map() does not need to strdup(key)
or free(key) when calling list_prepend(..., key) even though "key" comes
from pdb->p_types.table: because typealias_list_destroy() does not free
the inserted items. Add a comment to make this clearer in the code.

Signed-off-by: Nicolas Iooss <nicolas.iooss@m4x.org>
2018-05-30 21:59:59 +02:00
..
cil libsepol: cil: silence clang analyzer false positive 2018-05-30 21:59:52 +02:00
include libsepol: remove unused function and type 2018-05-08 08:11:58 -04:00
man libsepol: build: follow standard semantics for DESTDIR and PREFIX 2018-02-14 15:59:36 +01:00
src libsepol: do not leak memory if list_prepend fails 2018-05-30 21:59:59 +02:00
tests libsepol/tests: override CPPFLAGS too 2017-06-30 08:56:43 -04:00
utils libsepol: build: follow standard semantics for DESTDIR and PREFIX 2018-02-14 15:59:36 +01:00
.gitignore libsepol: build cil into libsepol 2014-08-26 08:03:31 -04:00
COPYING initial import from svn trunk revision 2950 2008-08-19 15:30:36 -04:00
Makefile libsepol: build cil into libsepol 2014-08-26 08:03:31 -04:00
VERSION Update VERSIONs to 2.8 for release. 2018-05-24 14:21:09 -04:00