ctdb-common: Fix crash in logging initialisation
authorMartin Schwenke <martin@meltin.net>
Thu, 1 Jun 2017 04:37:40 +0000 (14:37 +1000)
committerAmitay Isaacs <amitay@samba.org>
Thu, 1 Jun 2017 13:26:19 +0000 (15:26 +0200)
Setting CTDB_LOGGING to syslog:nonblocking or syslog:udp will cause
ctdbd to crash at startup due to NULL pointer dereference.
Refactoring in commit c9124a001f5abf7bb577a8f5341da4cc7411ed22
introduced this regression.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12814

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Thu Jun  1 15:26:19 CEST 2017 on sn-devel-144

ctdb/common/logging.c

index e1b8e7f2ecd0268c6f539042efdf4ba936a8e5a6..0e3efe0a7288ec125eb0647947f214a213debdc7 100644 (file)
@@ -354,6 +354,7 @@ static int syslog_log_setup_common(TALLOC_CTX *mem_ctx, const char *app_name,
        state->app_name = app_name;
        talloc_set_destructor(state, syslog_log_state_destructor);
 
+       *result = state;
        return 0;
 }