mirror of
https://github.com/curl/curl.git
synced 2026-08-25 07:23:31 +03:00
cppcheck: fix warnings
- Get rid of variable that was generating false positive warning (unitialized) - Fix issues in tests - Reduce scope of several variables all over etc Closes #2631
This commit is contained in:
parent
38203f1585
commit
c45360d463
61 changed files with 213 additions and 273 deletions
|
|
@ -376,13 +376,13 @@ static void strstore(char **str, const char *newstr)
|
|||
*/
|
||||
static void remove_expired(struct CookieInfo *cookies)
|
||||
{
|
||||
struct Cookie *co, *nx, *pv;
|
||||
struct Cookie *co, *nx;
|
||||
curl_off_t now = (curl_off_t)time(NULL);
|
||||
unsigned int i;
|
||||
|
||||
for(i = 0; i < COOKIE_HASH_SIZE; i++) {
|
||||
struct Cookie *pv = NULL;
|
||||
co = cookies->cookies[i];
|
||||
pv = NULL;
|
||||
while(co) {
|
||||
nx = co->next;
|
||||
if(co->expires && co->expires < now) {
|
||||
|
|
@ -1385,9 +1385,8 @@ void Curl_cookie_clearsess(struct CookieInfo *cookies)
|
|||
****************************************************************************/
|
||||
void Curl_cookie_cleanup(struct CookieInfo *c)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
if(c) {
|
||||
unsigned int i;
|
||||
free(c->filename);
|
||||
for(i = 0; i < COOKIE_HASH_SIZE; i++)
|
||||
Curl_cookie_freelist(c->cookies[i]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue