]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-dict: Compiler warning fix
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Sun, 8 May 2016 21:55:21 +0000 (00:55 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Sun, 8 May 2016 21:55:21 +0000 (00:55 +0300)
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

index 804808f96f9af279b77d9dc43178913675ad6558..b0841dae905ef78e225f2e6bc88e20565b0db644 100644 (file)
@@ -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)