Add ipc_refcnt to message_handler_req_{exec, lib}_cfg_ringreenable()

Without refcounting the conn pointer here, corosync will segfault
if one kills a running instance of "corosync-cfgtool -r" (rhbz#695191)

Signed-off-by: Tim Serong <tserong@novell.com>
Reviewed-by: Steven Dake <sdake@redhat.com>
This commit is contained in:
Tim Serong 2011-04-15 10:40:11 +10:00 committed by Steven Dake
parent 6a752ba1b1
commit 5b92829d6c

View File

@ -584,6 +584,8 @@ static void message_handler_req_exec_cfg_ringreenable (
req_exec_cfg_ringreenable->source.conn,
&res_lib_cfg_ringreenable,
sizeof (struct res_lib_cfg_ringreenable));
api->ipc_refcnt_dec(req_exec_cfg_ringreenable->source.conn);
}
LEAVE();
}
@ -704,6 +706,7 @@ static void message_handler_req_lib_cfg_ringreenable (
req_exec_cfg_ringreenable.header.id = SERVICE_ID_MAKE (CFG_SERVICE,
MESSAGE_REQ_EXEC_CFG_RINGREENABLE);
api->ipc_source_set (&req_exec_cfg_ringreenable.source, conn);
api->ipc_refcnt_inc(conn);
iovec.iov_base = (char *)&req_exec_cfg_ringreenable;
iovec.iov_len = sizeof (struct req_exec_cfg_ringreenable);