In case of an error condition the further processing of the data is cancelled
and the callback returns. In such a scenario the data has to be free'd.
Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
if (hdr->ctdb_magic != CTDB_MAGIC) {
ctdb_set_error(client->ctdb, "Non CTDB packet rejected\n");
- return;
+ goto err_out;
}
if (hdr->ctdb_version != CTDB_PROTOCOL) {
ctdb_set_error(client->ctdb, "Bad CTDB version 0x%x rejected in daemon\n", hdr->ctdb_version);
- return;
+ goto err_out;
}
DEBUG(DEBUG_DEBUG,(__location__ " client request %u of type %u length %u from "
/* it is the responsibility of the incoming packet function to free 'data' */
daemon_incoming_packet(client, hdr);
+ return;
+
+err_out:
+ TALLOC_FREE(data);
}