[patch] config: add HAL error checks

Keith Packard keithp at keithp.com
Tue Jul 28 13:54:00 PDT 2009


I was just looking at the patches proposed for 1.6.3 and found the
following change:

@ -517,13 +523,19 @@ connect_and_register(DBusConnection *connection, struct config_hal_info *info)
 
     return TRUE;
 
-out_ctx2:
-    if (!libhal_ctx_shutdown(info->hal_ctx, &error))
-        LogMessage(X_WARNING, "config/hal: couldn't shut down context: %s (%s)\n",
-		   error.name ? error.name : "unknown error",
-		   error.message ? error.message : "null");
 out_ctx:
-    libhal_ctx_free(info->hal_ctx);
+    dbus_error_free(&error);
+
+    if (info->hal_ctx) {
+        if (!libhal_ctx_shutdown(info->hal_ctx, &error)) {
+            LogMessage(X_WARNING, "config/hal: couldn't shut down context: %s (%s)\n",
+		       error.name ? error.name : "unknown error",
+		       error.message ? error.message : "null");
+            dbus_error_free(&error);
+        }
+        libhal_ctx_free(info->hal_ctx);
+    }
+
 out_err:
     dbus_error_free(&error);

Looks to me like dbus_error_free is called twice here. Surely that's wrong.
 
-- 
keith.packard at intel.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.x.org/archives/xorg-devel/attachments/20090728/0e1823b5/attachment.pgp 


More information about the xorg-devel mailing list