]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
ctdbd: Use talloc_memdup where appropriate
authorVolker Lendecke <vl@samba.org>
Mon, 4 Apr 2016 14:23:09 +0000 (16:23 +0200)
committerRalph Boehme <slow@samba.org>
Mon, 25 Apr 2016 16:29:21 +0000 (18:29 +0200)
.... 40 bytes .text less ;-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
ctdb/server/ctdb_daemon.c

index a5fefe33f0a4c19e47463ad68461a162aebc3549..321b86e49bce8b3d19b5632004acd07272548aa2 100644 (file)
@@ -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);