-
Simon McVittie authored
In the current implementation, we can reach the "err" label either because we ran out of memory, or because we got a socket error from getsockname() or inet_ntop(), and we blindly assume that running out of memory will set ENOMEM. However, that isn't actually true: when we are simulating OOM in dbus_malloc(), the fake OOM doesn't set ENOMEM. Handle the OOM condition explicitly instead. In the AF_UNIX case, the break statement is no longer reached at all, so leave a comment there. In the AF_INET and AF_INET6 cases, if inet_ntop() fails, explicitly goto err instead of using break (this has the same practical effect) to make it clearer that we are going to the "socket error" code path. Signed-off-by: Simon McVittie <smcv@collabora.com> Reviewed-by: Ralf Habacker <ralf.habacker@freenet.de> Bug: https://bugs.freedesktop.org/show_bug.cgi?id=61922
1d85b229