1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

ctdb-recoverd: Check if callback function is registered before calling

Fix suggested by by Kevin Osborn <kosborn@overlandstorage.com>.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Feb 27 13:54:59 CET 2014 on sn-devel-104
This commit is contained in:
Amitay Isaacs 2014-02-27 12:41:23 +11:00 committed by Martin Schwenke
parent 026996550d
commit 7d05baa96b

View File

@ -2578,8 +2578,13 @@ static void iprealloc_fail_callback(struct ctdb_context *ctdb, uint32_t pnn,
/* If the control timed out then that's a real error,
* so call the real fail callback
*/
cd->fail_callback(ctdb, pnn, res, outdata,
cd->fail_callback_data);
if (cd->fail_callback) {
cd->fail_callback(ctdb, pnn, res, outdata,
cd->fail_callback_data);
} else {
DEBUG(DEBUG_WARNING,
("iprealloc timed out but no callback registered\n"));
}
break;
default:
/* If not a timeout then either the ipreallocated