summaryrefslogtreecommitdiffstats
path: root/src/client.c
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2022-05-13 13:37:24 +0200
committerJavier Sánchez Parra <jsanchez@soleta.eu>2022-05-18 16:50:24 +0200
commit9b6171300b2b4d52f2d3d519a9b17393fcf0293c (patch)
tree5697ee290207ed57c4e02cdc1a965dcaff7e3f6a /src/client.c
parentdf5161ebc351df35504bd6366526a544ff6a96da (diff)
#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")
Diffstat (limited to 'src/client.c')
-rw-r--r--src/client.c2
1 files changed, 1 insertions, 1 deletions
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;