summaryrefslogtreecommitdiffstats
path: root/mono/DBusType/ObjectPath.cs
diff options
context:
space:
mode:
Diffstat (limited to 'mono/DBusType/ObjectPath.cs')
-rw-r--r--mono/DBusType/ObjectPath.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/mono/DBusType/ObjectPath.cs b/mono/DBusType/ObjectPath.cs
index 01a21ca9..4f064d59 100644
--- a/mono/DBusType/ObjectPath.cs
+++ b/mono/DBusType/ObjectPath.cs
@@ -52,7 +52,10 @@ namespace DBus.DBusType
{
IntPtr marshalVal = Marshal.StringToHGlobalAnsi (Path);
- if (!dbus_message_iter_append_basic (iter, (int) Code, ref marshalVal))
+ bool success = dbus_message_iter_append_basic (iter, (int) Code, ref marshalVal);
+ Marshal.FreeHGlobal (marshalVal);
+
+ if (!success)
throw new ApplicationException("Failed to append OBJECT_PATH argument:" + val);
}