From: Volker Lendecke Date: Mon, 4 Apr 2016 14:23:09 +0000 (+0200) Subject: ctdbd: Use talloc_memdup where appropriate X-Git-Tag: talloc-2.1.7~134 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=aad53cf59524355df757c9de7dca081da75b76d0;p=thirdparty%2Fsamba.git ctdbd: Use talloc_memdup where appropriate .... 40 bytes .text less ;-) Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/ctdb/server/ctdb_daemon.c b/ctdb/server/ctdb_daemon.c index a5fefe33f0a..321b86e49bc 100644 --- a/ctdb/server/ctdb_daemon.c +++ b/ctdb/server/ctdb_daemon.c @@ -1709,9 +1709,9 @@ int32_t ctdb_control_register_notify(struct ctdb_context *ctdb, uint32_t client_ nl->ctdb = ctdb; nl->srvid = notify->srvid; nl->data.dsize = notify->len; - nl->data.dptr = talloc_size(nl, nl->data.dsize); + nl->data.dptr = talloc_memdup(nl, notify->notify_data, + nl->data.dsize); CTDB_NO_MEMORY(ctdb, nl->data.dptr); - memcpy(nl->data.dptr, notify->notify_data, nl->data.dsize); DLIST_ADD(client->notify, nl); talloc_set_destructor(nl, ctdb_client_notify_destructor);