daandemeyer / rpms / systemd

Forked from rpms/systemd 2 years ago
Clone
65878a
From 7722552d5eade35dbb6c433e82774fcd2e157232 Mon Sep 17 00:00:00 2001
65878a
From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= <zbyszek@in.waw.pl>
65878a
Date: Mon, 6 Jan 2014 12:16:55 +0000
65878a
Subject: [PATCH] hostnamed: avoid using NULL in error path
65878a
65878a
https://bugzilla.redhat.com/show_bug.cgi?id=1047335
65878a
---
65878a
 src/hostname/hostnamed.c | 4 ++--
65878a
 1 file changed, 2 insertions(+), 2 deletions(-)
65878a
65878a
diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c
65878a
index 6a43aeb..0c24b65 100644
65878a
--- a/src/hostname/hostnamed.c
65878a
+++ b/src/hostname/hostnamed.c
65878a
@@ -637,7 +637,7 @@ static int connect_bus(DBusConnection **_bus) {
65878a
         if (!bus) {
65878a
                 log_error("Failed to get system D-Bus connection: %s", bus_error_message(&error));
65878a
                 r = -ECONNREFUSED;
65878a
-                goto fail;
65878a
+                goto fail2;
65878a
         }
65878a
 
65878a
         dbus_connection_set_exit_on_disconnect(bus, FALSE);
65878a
@@ -669,7 +669,7 @@ static int connect_bus(DBusConnection **_bus) {
65878a
 fail:
65878a
         dbus_connection_close(bus);
65878a
         dbus_connection_unref(bus);
65878a
-
65878a
+fail2:
65878a
         dbus_error_free(&error);
65878a
 
65878a
         return r;