From: Marc-André Lureau <marcandre.lur...@redhat.com>

Helps avoid/debug a potential SEGV if conn is NULL, since gio will not
set the "gerror" in that case and we will crash later at:
  virReportError(VIR_ERR_DBUS_SERVICE, "%s", gerror->message);

Signed-off-by: Marc-André Lureau <marcandre.lur...@redhat.com>
---
 src/util/virgdbus.h | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/src/util/virgdbus.h b/src/util/virgdbus.h
index dfe6138112..65e7ba7be4 100644
--- a/src/util/virgdbus.h
+++ b/src/util/virgdbus.h
@@ -54,7 +54,11 @@ virGDBusCallMethod(GDBusConnection *conn,
                    const char *objectPath,
                    const char *ifaceName,
                    const char *method,
-                   GVariant *data);
+                   GVariant *data)
+    ATTRIBUTE_NONNULL(1)
+    ATTRIBUTE_NONNULL(6)
+    ATTRIBUTE_NONNULL(7)
+    ATTRIBUTE_NONNULL(8);
 
 int
 virGDBusCallMethodWithFD(GDBusConnection *conn,
@@ -67,7 +71,12 @@ virGDBusCallMethodWithFD(GDBusConnection *conn,
                          const char *ifaceName,
                          const char *method,
                          GVariant *data,
-                         GUnixFDList *dataFD);
+                         GUnixFDList *dataFD)
+    ATTRIBUTE_NONNULL(1)
+    ATTRIBUTE_NONNULL(7)
+    ATTRIBUTE_NONNULL(8)
+    ATTRIBUTE_NONNULL(9);
+
 
 int
 virGDBusIsServiceEnabled(const char *name);
-- 
2.47.0

Reply via email to