cookie: fix declaration of 'dup' shadows a global declaration

This commit is contained in:
Daniel Stenberg 2017-02-21 17:44:02 +01:00
parent ca6ea6d9be
commit 588960be2c

View file

@ -1064,16 +1064,16 @@ static int cookie_sort(const void *p1, const void *p2)
#define CLONE(field) \ #define CLONE(field) \
do { \ do { \
if(src->field) { \ if(src->field) { \
dup->field = strdup(src->field); \ d->field = strdup(src->field); \
if(!dup->field) \ if(!d->field) \
goto fail; \ goto fail; \
} \ } \
} while(0) } while(0)
static struct Cookie *dup_cookie(struct Cookie *src) static struct Cookie *dup_cookie(struct Cookie *src)
{ {
struct Cookie *dup = calloc(sizeof(struct Cookie), 1); struct Cookie *d = calloc(sizeof(struct Cookie), 1);
if(dup) { if(d) {
CLONE(expirestr); CLONE(expirestr);
CLONE(domain); CLONE(domain);
CLONE(path); CLONE(path);
@ -1082,16 +1082,16 @@ static struct Cookie *dup_cookie(struct Cookie *src)
CLONE(value); CLONE(value);
CLONE(maxage); CLONE(maxage);
CLONE(version); CLONE(version);
dup->expires = src->expires; d->expires = src->expires;
dup->tailmatch = src->tailmatch; d->tailmatch = src->tailmatch;
dup->secure = src->secure; d->secure = src->secure;
dup->livecookie = src->livecookie; d->livecookie = src->livecookie;
dup->httponly = src->httponly; d->httponly = src->httponly;
} }
return dup; return d;
fail: fail:
freecookie(dup); freecookie(d);
return NULL; return NULL;
} }