libqb/lib
Jan Pokorný 41ae3e1267 Memleak fixes (#194)
* memleak: ipc_socket: properly dispose local-scoped strndup values

Leaking memory was only possible when using filesystem sockets (see
use_filesystem_sockets function) and either:
- client is deliberately disconnecting from a server (continued run
  imposes a risk of exhausting memory)
- server is deliberately disconnecting from its client (ditto, but
  more substantial risk due to the common shared-resource nature
  of the server)

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>

* memleak: ipc_socket: properly dispose inter-function strdup values

Leaking memory was only possible when the server accepted the client,
but didn't get (or was too shy) to talk to it prior to proceeding with
a disconnect.

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>

* ipc_socket: care to explain what's going on with file name inference

Related to the code parts at hand, there was an investigation/fix in
the past, initiated by "make check" failure on FreeBSD 9 [rhbz#1256701].
Unfortunately, not only the magic constant being modified was not
explained in 1908e6c, but (one can derive because of a lack of solid
background of what's going on here, which might have caused that),
it was modified incorrectly at one instance (see also [PR165 comment]),
which was then reinstated in 7ebcb3d.

So, finally de-mystify those magic constants.  Also break the symmetry
between the client/server further with depending on the canonical
"request socket" alias at the server side (the former worked equally but
it was unnecessarily confusing and there's a risk this artificial alias
will get removed in the future).

[rhbz#1256701] https://bugzilla.redhat.com/1256701
[PR165 comment] https://github.com/ClusterLabs/libqb/issues/165#issuecomment-142949541

Signed-off-by: Jan Pokorný <jpokorny@redhat.com>
2017-05-18 11:29:15 +01:00
..
.gitignore Cleanup the .gitignore files 2012-05-09 21:43:58 +10:00
array.c LOG: set the return code when calloc fails 2012-11-23 10:24:56 +11:00
atomic_int.h Add internal support for the new __atomic gcc builtins 2013-05-13 10:15:55 +10:00
hashtable.c Add the processing which remove notifier at skiplist_destroy function 2013-01-15 01:57:29 +09:00
hdb.c Unify to QB_TRUE/QB_FALSE a boolean value 2013-01-11 02:01:06 +09:00
ipc_int.h Allow Linux to use filesystem sockets (#248) 2017-04-28 16:13:02 +01:00
ipc_setup.c Allow Linux to use filesystem sockets (#248) 2017-04-28 16:13:02 +01:00
ipc_shm.c Med: rb: make it more robust against trivial IPC API misuses 2016-11-04 19:02:32 +01:00
ipc_socket.c Memleak fixes (#194) 2017-05-18 11:29:15 +01:00
ipcc.c Low: sanitize import of <poll.h> symbols 2016-10-17 17:39:09 +02:00
ipcs.c Low: sanitize import of <poll.h> symbols 2016-10-17 17:39:09 +02:00
libqb.pc.in build: fix libqb.pc creation and make maintainer-clean 2012-08-27 15:07:36 +02:00
log_blackbox.c Med: rb: make it more robust against trivial IPC API misuses 2016-11-04 19:02:32 +01:00
log_dcs.c LOG: copy the function/filename for dynamic callsites 2013-03-20 17:10:35 +11:00
log_file.c LOG: make it possible to fsync() on each file log. 2012-06-05 12:07:35 +10:00
log_format.c Merge pull request #217 from jnpkrn/log-serialize-check-char-properly 2016-06-20 08:52:53 +01:00
log_int.h Feature: Implement "extended" logging using a marker character 2015-04-30 12:14:53 -04:00
log_syslog.c Get coverity to ignore this warning. 2012-02-03 14:42:25 +11:00
log_thread.c Refactor: log_thread: fix and diminish inferior comments 2016-10-21 09:42:48 +02:00
log.c log: Don't overwrite valid tags 2016-10-18 14:30:28 +01:00
loop_int.h LOOP: make it possible to pass in NULL as the default loop instance 2012-02-10 14:47:49 +11:00
loop_job.c Unify the list processing with qb_list function 2013-01-09 02:04:20 +09:00
loop_poll_epoll.c epoll: don't miss poll events under high load 2014-06-05 15:25:26 +10:00
loop_poll_int.h POLL: seperate out the poll/epoll and add kqueue 2012-04-04 00:26:20 +10:00
loop_poll_kqueue.c The udata member of the kevent struct is a void * 2015-01-23 01:58:02 +01:00
loop_poll_poll.c POLL: seperate out the poll/epoll and add kqueue 2012-04-04 00:26:20 +10:00
loop_poll.c loop: Fix splint error 2017-03-06 14:31:57 +00:00
loop_timerlist.c TIMER: check for null timer handle 2012-03-09 12:17:03 +11:00
loop.c Avoid double-decrement of level->todo 2013-08-20 09:30:16 +10:00
Makefile.am configure: restrict socket lib to where it's actually needed 2016-12-12 11:47:21 +01:00
map_int.h PTRIE: refcount the notifier structs 2012-01-25 16:09:32 +11:00
map.c MAP: add a notifier purely to allow the user to free memory. 2011-12-14 00:26:01 +11:00
ringbuffer_helper.c Med: rb: use new qb_rb_close_helper able to resort to file truncating 2016-11-04 19:05:35 +01:00
ringbuffer_int.h Med: rb: use new qb_rb_close_helper able to resort to file truncating 2016-11-04 19:05:35 +01:00
ringbuffer.c [tests] Fix qb_rb_chunk_peek test so it's consistent with qb_rb_read 2017-01-31 10:41:29 +00:00
rpl_sem.c rpl_sem: make destroy more compliant 2013-02-19 12:40:06 +11:00
rpl_sem.h rpl_sem: make destroy more compliant 2013-02-19 12:40:06 +11:00
skiplist.c Add the processing which remove notifier at skiplist_destroy function 2013-01-15 01:57:29 +09:00
strchrnul.c Use safer versions of string functions (strcpy -> strlcpy) 2012-02-08 22:00:49 +11:00
strlcat.c Fix strlcpy and strlcat functions 2012-12-19 10:42:08 +11:00
strlcpy.c Fix strlcpy and strlcat functions 2012-12-19 10:42:08 +11:00
trie.c High: trie: allow modifying the trie map during the notify callback 2014-07-30 09:58:04 -05:00
unix.c Low: unix: new qb_sys_unlink_or_truncate{,_at} helpers 2016-11-04 19:02:50 +01:00
util_int.h Low: unix: new qb_sys_unlink_or_truncate{,_at} helpers 2016-11-04 19:02:50 +01:00
util.c Add Hurd support 2016-03-17 13:47:16 +01:00