Unverified Commit 2099dde2 authored by Daniel Gustafsson's avatar Daniel Gustafsson Committed by Daniel Stenberg
Browse files

cookies: Move failure case label to end of function

Rather than jumping backwards to where failure cleanup happens
to be performed, move the failure case to end of the function
where it is expected per existing coding convention.

Closes #2965
parent 1870fd28
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -1262,12 +1262,8 @@ struct Cookie *Curl_cookie_getlist(struct CookieInfo *c,

            matches++;
          }
          else {
            fail:
            /* failure, clear up the allocated chain and return NULL */
            Curl_cookie_freelist(mainco);
            return NULL;
          }
          else
            goto fail;
        }
      }
    }
@@ -1305,6 +1301,11 @@ struct Cookie *Curl_cookie_getlist(struct CookieInfo *c,
  }

  return mainco; /* return the new list */

fail:
  /* failure, clear up the allocated chain and return NULL */
  Curl_cookie_freelist(mainco);
  return NULL;
}

/*****************************************************************************