mirror of
https://github.com/moparisthebest/curl
synced 2024-12-23 16:48:49 -05: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
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…
Reference in New Issue
Block a user