s3: Use talloc_tos() in notify_send()
authorVolker Lendecke <vl@samba.org>
Wed, 14 Mar 2012 10:30:28 +0000 (11:30 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 15 Mar 2012 11:43:41 +0000 (12:43 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Mar 15 12:43:41 CET 2012 on sn-devel-104

source3/smbd/notify_internal.c

index 7891601bfe797337f217aa66b746298ef86e949d..d442367b2b06d449d8fc9ba7cfe01a63a72c8313 100644 (file)
@@ -817,24 +817,20 @@ static NTSTATUS notify_send(struct notify_context *notify, struct notify_entry *
        DATA_BLOB data;
        NTSTATUS status;
        enum ndr_err_code ndr_err;
-       TALLOC_CTX *tmp_ctx;
 
        ev.action = action;
        ev.path = path;
        ev.private_data = e->private_data;
 
-       tmp_ctx = talloc_new(notify);
-
-       ndr_err = ndr_push_struct_blob(&data, tmp_ctx, &ev,
+       ndr_err = ndr_push_struct_blob(&data, talloc_tos(), &ev,
                                       (ndr_push_flags_fn_t)ndr_push_notify_event);
        if (!NDR_ERR_CODE_IS_SUCCESS(ndr_err)) {
-               talloc_free(tmp_ctx);
                return ndr_map_error2ntstatus(ndr_err);
        }
 
        status = messaging_send(notify->messaging_ctx, e->server,
                                MSG_PVFS_NOTIFY, &data);
-       talloc_free(tmp_ctx);
+       TALLOC_FREE(data.data);
        return status;
 }