From 7f0a36600a2717cbe0fa33b8fad8832114c8abdd Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Fri, 15 Nov 2019 12:03:13 +1030 Subject: [PATCH] lightningd: fix uninitialized variable ==1310== Conditional jump or move depends on uninitialised value(s) ==1310== at 0x127C7F: io_loop_with_timers (io_loop_with_timers.c:30) ==1310== by 0x14F0E1: plugins_init (plugin.c:1019) ==1310== by 0x12E4B1: main (lightningd.c:694) ==1310== Signed-off-by: Rusty Russell --- lightningd/lightningd.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lightningd/lightningd.c b/lightningd/lightningd.c index c95737519..06a67194e 100644 --- a/lightningd/lightningd.c +++ b/lightningd/lightningd.c @@ -213,6 +213,10 @@ static struct lightningd *new_lightningd(const tal_t *ctx) ld->tor_service_password = NULL; ld->max_funding_unconfirmed = 2016; + /*~ This is initialized later, but the plugin loop examines this, + * so set it to NULL explicitly now. */ + ld->wallet = NULL; + /*~ In the next step we will initialize the plugins. This will * also populate the JSON-RPC with passthrough methods, hence * lightningd needs to have something to put those in. This