mirror of
https://github.com/curl/curl.git
synced 2026-05-14 03:36:21 +03:00
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
This commit is contained in:
parent
1870fd2832
commit
2099dde2c8
1 changed files with 7 additions and 6 deletions
13
lib/cookie.c
13
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;
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue