]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
auth_set_unix_credentials: Fix calling _dbus_credentials_add_pid without checking...
authorRalf Habacker <ralf.habacker@freenet.de>
Tue, 5 May 2015 15:10:01 +0000 (17:10 +0200)
committerRalf Habacker <ralf.habacker@freenet.de>
Wed, 6 May 2015 10:14:47 +0000 (12:14 +0200)
Reported by Coverity: CID 54708: Unchecked return value (CHECKED_RETURN)

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=90021
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
dbus/dbus-auth-script.c

index fdbe1fe48b6ead529c1635e93bda0b2e85134b24..738722037a882e482f501b6d678a94e88f120366 100644 (file)
@@ -226,8 +226,10 @@ auth_set_unix_credentials(DBusAuth  *auth,
         _dbus_assert_not_reached ("no memory");
     }
   if (pid != DBUS_PID_UNSET)
-    _dbus_credentials_add_pid (credentials, pid);
-
+    {
+      if (!_dbus_credentials_add_pid (credentials, pid))
+        _dbus_assert_not_reached ("no memory");
+    }
   _dbus_auth_set_credentials (auth, credentials);
 
   _dbus_credentials_unref (credentials);