]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-master: Crashfix for handling auth master lookup failures.
authorTimo Sirainen <tss@iki.fi>
Wed, 7 Apr 2010 00:16:30 +0000 (03:16 +0300)
committerTimo Sirainen <tss@iki.fi>
Wed, 7 Apr 2010 00:16:30 +0000 (03:16 +0300)
--HG--
branch : HEAD

src/lib-master/master-login.c

index cc4392fd6e105dfd281ae92c4a7f4839fbdfc11b..72a2cce4010e214ecb610f21c4da011a41c8bdb6 100644 (file)
@@ -426,7 +426,7 @@ static void master_login_conn_deinit(struct master_login_connection **_conn)
 
        if (conn->io != NULL)
                io_remove(&conn->io);
-       o_stream_unref(&conn->output);
+       o_stream_close(conn->output);
        if (close(conn->fd) < 0)
                i_error("close(master login) failed: %m");
        conn->fd = -1;
@@ -442,10 +442,12 @@ static void master_login_conn_unref(struct master_login_connection **_conn)
 
        i_assert(conn->refcount > 0);
 
-       if (--conn->refcount == 0) {
-               *_conn = NULL;
-               i_free(conn);
-       }
+       if (--conn->refcount > 0)
+               return;
+
+       *_conn = NULL;
+       o_stream_unref(&conn->output);
+       i_free(conn);
 }
 
 void master_login_stop(struct master_login *login)