]> git.ipfire.org Git - thirdparty/dbus.git/commitdiff
bus_connection_get_unix_groups: NULL-check *groups, not groups
authorRalf Habacker <ralf.habacker@freenet.de>
Tue, 20 Mar 2018 08:54:27 +0000 (09:54 +0100)
committerRalf Habacker <ralf.habacker@freenet.de>
Tue, 20 Mar 2018 12:27:59 +0000 (13:27 +0100)
groups is never NULL here, but *groups can be NULL on OOM, and that's the
check that was intended.

Coverity ID 265358.

Bug: https://bugs.freedesktop.org/show_bug.cgi?id=103737
Reviewed-by: Simon McVittie <smcv@collabora.com>
bus/connection.c

index bcd4aef452d632c6d441cc34c265d35ec5037e88..35f8e36ef93bb331f45c3b90a8e974c94b6acda6 100644 (file)
@@ -1064,7 +1064,7 @@ bus_connection_get_unix_groups  (DBusConnection   *connection,
       *n_groups = n;
       *groups = dbus_new (unsigned long, n);
 
-      if (groups == NULL)
+      if (*groups == NULL)
         {
           BUS_SET_OOM (error);
           return FALSE;