summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Gustafsson <daniel@yesql.se>2018-09-10 00:20:34 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-09-10 08:33:08 +0200
commit2099dde2c84a57cd9fe2298f0953c5dca0e94d43 (patch)
treeb8b143f2a6316a8622c9cffce7c7b48d11564444
parent1870fd2832d82781abc4443ffd344925f161bc4a (diff)
downloadcurl-2099dde2c84a57cd9fe2298f0953c5dca0e94d43.tar.gz
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
-rw-r--r--lib/cookie.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/cookie.c b/lib/cookie.c
index 732ba9b83..5b7ab6633 100644
--- a/lib/cookie.c
+++ b/lib/cookie.c
@@ -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;
}
/*****************************************************************************