From 3fdae9cc0f5d6ce05afdaf1e2ab35fb5dbdf0d17 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Mon, 9 May 2016 00:55:21 +0300 Subject: [PATCH] lib-dict: Compiler warning fix I don't think it's possible that error was used uninitialized, but some gcc version seems to think so. --- src/lib-dict/dict-redis.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib-dict/dict-redis.c b/src/lib-dict/dict-redis.c index 804808f96f..b0841dae90 100644 --- a/src/lib-dict/dict-redis.c +++ b/src/lib-dict/dict-redis.c @@ -275,7 +275,7 @@ redis_conn_input_more(struct redis_connection *conn, const char **error_r) static void redis_conn_input(struct connection *_conn) { struct redis_connection *conn = (struct redis_connection *)_conn; - const char *error; + const char *error = NULL; int ret; switch (i_stream_read(_conn->input)) { @@ -289,8 +289,10 @@ static void redis_conn_input(struct connection *_conn) } while ((ret = redis_conn_input_more(conn, &error)) > 0) ; - if (ret < 0) + if (ret < 0) { + i_assert(error != NULL); redis_disconnected(conn, error); + } } static void redis_conn_connected(struct connection *_conn, bool success)