From 0fa209c64d87012f7365c9bce421482f70fa3e7f Mon Sep 17 00:00:00 2001 From: William Casarin Date: Sun, 30 Dec 2018 11:21:42 -0500 Subject: [PATCH] lightningd: fix compile error in peer_control MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Error on gcc 7.3.0: lightningd/peer_control.c: In function ‘json_close’: lightningd/peer_control.c:955:3: error: ‘channel’ may be used uninitialized in this function [-Werror=maybe-uninitialized] channel_set_state(channel, ^~~~~~~~~~~~~~~~~~~~~~~~~~ channel->state, CHANNELD_SHUTTING_DOWN); Signed-off-by: William Casarin --- lightningd/peer_control.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lightningd/peer_control.c b/lightningd/peer_control.c index 3b4292dc6..bdf27ff27 100644 --- a/lightningd/peer_control.c +++ b/lightningd/peer_control.c @@ -901,7 +901,7 @@ static struct command_result *json_close(struct command *cmd, { const jsmntok_t *idtok; struct peer *peer; - struct channel *channel; + struct channel *channel = NULL; unsigned int *timeout; bool *force;