#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")
master
Javier Sánchez Parra 2022-05-13 13:37:24 +02:00
parent df5161ebc3
commit 9b6171300b
1 changed files with 1 additions and 1 deletions

View File

@ -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;