_dbus_listen_tcp_socket: Don't rely on dbus_realloc setting errno
authorSimon McVittie <smcv@collabora.com>
Tue, 21 Nov 2017 14:43:01 +0000 (14:43 +0000)
committerSimon McVittie <smcv@collabora.com>
Fri, 24 Nov 2017 13:42:27 +0000 (13:42 +0000)
commitc393aefb34dd466265a33fe5c431b747d7a44b86
tree91f52aab2214a5967f8f3234c04279d7f8d17ca2
parentd166252a8d6769a8ac3480b8fcce611b3783e4cc
_dbus_listen_tcp_socket: Don't rely on dbus_realloc setting errno

dbus_realloc() doesn't guarantee to set errno (if it did, the
only reasonable thing it could set it to would be ENOMEM). In
particular, faking OOM conditions doesn't set it. This can cause an
assertion failure when OOM tests assert that the only error that can
validly occur is DBUS_ERROR_NO_MEMORY.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Reviewed-by: Philip Withnall <withnall@endlessm.com>
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=89104
(cherry picked from commit 9ded6907e66b89c3c74620a4485e8f752f092a60)
dbus/dbus-sysdeps-unix.c