_dbus_listen_tcp_socket: unify cleanup for EADDRINUSE and other failures
authorSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 18 Jan 2011 16:07:24 +0000 (16:07 +0000)
committerSimon McVittie <simon.mcvittie@collabora.co.uk>
Tue, 18 Jan 2011 16:07:24 +0000 (16:07 +0000)
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=29881

dbus/dbus-sysdeps-unix.c

index 7635264..8104073 100644 (file)
@@ -1438,8 +1438,7 @@ _dbus_listen_tcp_socket (const char     *host,
       dbus_set_error (error, _dbus_error_from_errno (errno),
                       "Failed to bind socket \"%s:%s\": %s",
                       host ? host : "*", port, _dbus_strerror (errno));
-      dbus_free (listen_fd);
-      return -1;
+      goto failed;
     }
 
   for (i = 0 ; i < nlisten_fd ; i++)