From 9b6171300b2b4d52f2d3d519a9b17393fcf0293c Mon Sep 17 00:00:00 2001 From: Javier Sánchez Parra Date: Fri, 13 May 2022 13:37:24 +0200 Subject: #915 Fix conditional jump depending on uninitialised value Valgrind says: ==9452== 1 errors in context 1 of 38: ==9452== Conditional jump or move depends on uninitialised value(s) ==9452== at 0x11BD1E: og_resp_refresh (client.c:383) ==9452== by 0x11CF2A: og_agent_state_process_response (client.c:822) ==9452== by 0x112FCE: og_agent_read_cb (core.c:254) ==9452== by 0x4E41D72: ev_invoke_pending (in /usr/lib/x86_64-linux-gnu/libev.so.4.0.0) ==9452== by 0x4E453DD: ev_run (in /usr/lib/x86_64-linux-gnu/libev.so.4.0.0) ==9452== by 0x1107CD: ev_loop (ev.h:835) ==9452== by 0x1107CD: main (main.c:108) ==9452== Uninitialised value was created by a stack allocation ==9452== at 0x11BB02: og_resp_refresh (client.c:348) Fixes: f03425e ("#915 Add support for link speed in the refresh response") --- src/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client.c b/src/client.c index a53f52c..e01fc38 100644 --- a/src/client.c +++ b/src/client.c @@ -353,9 +353,9 @@ static int og_resp_refresh(json_t *data, struct og_client *cli) const char *status = NULL; char cfg[4096] = {}; struct og_dbi *dbi; + uint32_t link = 0; const char *key; unsigned int i; - uint32_t link; json_t *value; int err = 0; bool res; -- cgit v1.2.3-18-g5258