[PATCH 1/3] vfs_snapper: free dbus req messages in error paths

David Disseldorp ddiss at samba.org
Wed Jan 21 10:16:55 MST 2015


Bug: https://bugzilla.samba.org/show_bug.cgi?id=11055

Signed-off-by: David Disseldorp <ddiss at samba.org>
---
 source3/modules/vfs_snapper.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/source3/modules/vfs_snapper.c b/source3/modules/vfs_snapper.c
index 12a3b9a..ed6e073 100644
--- a/source3/modules/vfs_snapper.c
+++ b/source3/modules/vfs_snapper.c
@@ -472,6 +472,7 @@ static NTSTATUS snapper_list_snaps_pack(char *snapper_conf,
 	dbus_message_iter_init_append(msg, &args);
 	if (!dbus_message_iter_append_basic(&args, DBUS_TYPE_STRING,
 					    &snapper_conf)) {
+		dbus_message_unref(msg);
 		return NT_STATUS_NO_MEMORY;
 	}
 
@@ -690,16 +691,19 @@ static NTSTATUS snapper_list_snaps_at_time_pack(const char *snapper_conf,
 	dbus_message_iter_init_append(msg, &args);
 	if (!dbus_message_iter_append_basic(&args, DBUS_TYPE_STRING,
 					    &snapper_conf)) {
+		dbus_message_unref(msg);
 		return NT_STATUS_NO_MEMORY;
 	}
 
 	if (!dbus_message_iter_append_basic(&args, DBUS_TYPE_INT64,
 					    &time_lower)) {
+		dbus_message_unref(msg);
 		return NT_STATUS_NO_MEMORY;
 	}
 
 	if (!dbus_message_iter_append_basic(&args, DBUS_TYPE_INT64,
 					    &time_upper)) {
+		dbus_message_unref(msg);
 		return NT_STATUS_NO_MEMORY;
 	}
 
-- 
2.1.2



More information about the samba-technical mailing list