]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-imap-urlauth: Fixed URLAUTH fetch reference counting for when requests are aborte...
authorStephan Bosch <stephan@rename-it.nl>
Thu, 30 May 2013 15:03:53 +0000 (18:03 +0300)
committerStephan Bosch <stephan@rename-it.nl>
Thu, 30 May 2013 15:03:53 +0000 (18:03 +0300)
src/lib-imap-urlauth/imap-urlauth-fetch.c

index 0ba4dfada1b01b2a08952026161d722bf6373d43..6174ff096e67fb78027a30129c15fd139fe53a29 100644 (file)
@@ -121,11 +121,14 @@ static void imap_urlauth_fetch_unref(struct imap_urlauth_fetch **_ufetch)
        i_assert(ufetch->refcount > 0);
 
        *_ufetch = NULL;
-       if (--ufetch->refcount > 0)
+       if (ufetch->refcount-1 > 0)
                return;
 
        imap_urlauth_fetch_abort(ufetch);
 
+       ufetch->refcount--;
+       i_assert(ufetch->refcount == 0);
+
        /* dont leave the connection in limbo; make sure resume is called */
        if (ufetch->waiting_service)
                imap_urlauth_connection_continue(ufetch->uctx->conn);