]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- fixed memory leak in DBus Marshalling 1041/head
authorArvin Schnell <aschnell@suse.de>
Mon, 4 Aug 2025 15:01:56 +0000 (17:01 +0200)
committerArvin Schnell <aschnell@suse.de>
Mon, 4 Aug 2025 15:01:56 +0000 (17:01 +0200)
dbus/DBusMessage.cc
dbus/DBusMessage.h
package/snapper.changes

index 9670d2d0dbf2dce9f176e7f082920698028ffd28..ac5cb4976f0109cd8bfdd71b6e5d3e5dbc3c7bc8 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012 Novell, Inc.
- * Copyright (c) [2016-2023] SUSE LLC
+ * Copyright (c) [2016-2025] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -71,6 +71,19 @@ namespace DBus
     const char* TypeInfo<string>::signature = "s";
 
 
+    string
+    Marshalling::get_signature()
+    {
+       char* tmp = dbus_message_iter_get_signature(top());
+       if (!tmp)
+           SN_THROW(FatalException());
+
+       string sig = tmp;
+       dbus_free(tmp);
+       return sig;
+    }
+
+
     Unmarshaller::Unmarshaller(Message& msg)
     {
        iters.push_back(new DBusMessageIter());
@@ -119,6 +132,7 @@ namespace DBus
        assert(iters.empty());
     }
 
+
     void
     Marshaller::open_struct()
     {
index ba92fc0bc6a504052b990f12098ea00ef79bbbde..20205f6a7e3567081bbee3c04974976c6cf564e9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2012 Novell, Inc.
- * Copyright (c) [2016-2023] SUSE LLC
+ * Copyright (c) [2016-2025] SUSE LLC
  *
  * All Rights Reserved.
  *
@@ -185,7 +185,7 @@ namespace DBus
        DBusMessageIter* top() { return iters.back(); }
 
        int get_type() { return dbus_message_iter_get_arg_type(top()); }
-       string get_signature() { return dbus_message_iter_get_signature(top()); }
+       string get_signature();
 
     protected:
 
index a9653565339babbf19276414932beee53b28fda8..3fd6a250227c7f12a1dd2919d88872a67744a718 100644 (file)
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Mon Aug 04 17:00:45 CEST 2025 - Arvin Schnell <aschnell@suse.com>
+
+- fixed memory leak in DBus Marshalling
+
 -------------------------------------------------------------------
 Wed Jul 23 10:35:22 CEST 2025 - aschnell@suse.com