mirror of
https://github.com/curl/curl.git
synced 2026-08-26 21:03:34 +03:00
cookie: fix declaration of 'dup' shadows a global declaration
This commit is contained in:
parent
ca6ea6d9be
commit
588960be2c
1 changed files with 11 additions and 11 deletions
22
lib/cookie.c
22
lib/cookie.c
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue