From: David Disseldorp Date: Wed, 21 Jan 2015 17:16:55 +0000 (+0100) Subject: vfs_snapper: free dbus req messages in error paths X-Git-Tag: samba-4.2.0rc5~53 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1381ac030864b19a4194ca90a4f6fad74b20b8dd;p=thirdparty%2Fsamba.git vfs_snapper: free dbus req messages in error paths Bug: https://bugzilla.samba.org/show_bug.cgi?id=11055 Signed-off-by: David Disseldorp Reviewed-by: Jeremy Allison (cherry picked from commit f72fa6390b73f47a57033282335786c24664a3f8) --- diff --git a/source3/modules/vfs_snapper.c b/source3/modules/vfs_snapper.c index 12a3b9a16eb..ed6e0737647 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; }