Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
varnish-cache
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Commits
Open sidebar
varnishcache
varnish-cache
Commits
aeead7e7
Commit
aeead7e7
authored
Dec 26, 2019
by
Dridi Boukelmoune
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Plug minor leak
parent
07a09db9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
31 deletions
+41
-31
mgt_param.c
bin/varnishd/mgt/mgt_param.c
+41
-27
lsan.suppr
tools/lsan.suppr
+0
-4
No files found.
bin/varnishd/mgt/mgt_param.c
View file @
aeead7e7
...
...
@@ -575,16 +575,47 @@ MCF_AddParams(struct parspec *ps)
*/
static
void
mcf_wash_param
(
struct
cli
*
cli
,
const
struct
parspec
*
pp
,
const
char
**
val
,
mcf_dyn_vsb
(
enum
mcf_which_e
which
,
struct
parspec
*
pp
,
struct
vsb
*
vsb
)
{
switch
(
which
)
{
case
MCF_DEFAULT
:
REPLACE
(
pp
->
dyn_def
,
VSB_data
(
vsb
));
pp
->
def
=
pp
->
dyn_def
;
break
;
case
MCF_MINIMUM
:
REPLACE
(
pp
->
dyn_min
,
VSB_data
(
vsb
));
pp
->
min
=
pp
->
dyn_min
;
break
;
case
MCF_MAXIMUM
:
REPLACE
(
pp
->
dyn_max
,
VSB_data
(
vsb
));
pp
->
max
=
pp
->
dyn_max
;
break
;
default:
WRONG
(
"bad 'which'"
);
}
}
static
void
mcf_wash_param
(
struct
cli
*
cli
,
struct
parspec
*
pp
,
enum
mcf_which_e
which
,
const
char
*
name
,
struct
vsb
*
vsb
)
{
const
char
*
val
;
int
err
;
AN
(
*
val
);
switch
(
which
)
{
case
MCF_DEFAULT
:
val
=
pp
->
def
;
break
;
case
MCF_MINIMUM
:
val
=
pp
->
min
;
break
;
case
MCF_MAXIMUM
:
val
=
pp
->
max
;
break
;
default:
WRONG
(
"bad 'which'"
);
}
AN
(
val
);
VSB_clear
(
vsb
);
VSB_printf
(
vsb
,
"FAILED to set %s for param %s: %s
\n
"
,
name
,
pp
->
name
,
*
val
);
err
=
pp
->
func
(
vsb
,
pp
,
*
val
);
name
,
pp
->
name
,
val
);
err
=
pp
->
func
(
vsb
,
pp
,
val
);
AZ
(
VSB_finish
(
vsb
));
if
(
err
)
{
VCLI_Out
(
cli
,
"%s
\n
"
,
VSB_data
(
vsb
));
...
...
@@ -595,10 +626,8 @@ mcf_wash_param(struct cli *cli, const struct parspec *pp, const char **val,
err
=
pp
->
func
(
vsb
,
pp
,
NULL
);
AZ
(
err
);
AZ
(
VSB_finish
(
vsb
));
if
(
strcmp
(
*
val
,
VSB_data
(
vsb
)))
{
*
val
=
strdup
(
VSB_data
(
vsb
));
AN
(
*
val
);
}
if
(
strcmp
(
val
,
VSB_data
(
vsb
)))
mcf_dyn_vsb
(
which
,
pp
,
vsb
);
}
/*--------------------------------------------------------------------*/
...
...
@@ -679,11 +708,11 @@ MCF_InitParams(struct cli *cli)
if
(
pp
->
flags
&
NOT_IMPLEMENTED
)
continue
;
if
(
pp
->
min
!=
NULL
)
mcf_wash_param
(
cli
,
pp
,
&
pp
->
min
,
"minimum"
,
vsb
);
mcf_wash_param
(
cli
,
pp
,
MCF_MINIMUM
,
"minimum"
,
vsb
);
if
(
pp
->
max
!=
NULL
)
mcf_wash_param
(
cli
,
pp
,
&
pp
->
max
,
"maximum"
,
vsb
);
mcf_wash_param
(
cli
,
pp
,
MCF_MAXIMUM
,
"maximum"
,
vsb
);
AN
(
pp
->
def
);
mcf_wash_param
(
cli
,
pp
,
&
pp
->
def
,
"default"
,
vsb
);
mcf_wash_param
(
cli
,
pp
,
MCF_DEFAULT
,
"default"
,
vsb
);
}
VSB_destroy
(
&
vsb
);
}
...
...
@@ -706,22 +735,7 @@ MCF_ParamConf(enum mcf_which_e which, const char * const param,
VSB_vprintf
(
vsb
,
fmt
,
ap
);
va_end
(
ap
);
AZ
(
VSB_finish
(
vsb
));
switch
(
which
)
{
case
MCF_DEFAULT
:
REPLACE
(
pp
->
dyn_def
,
VSB_data
(
vsb
));
pp
->
def
=
pp
->
dyn_def
;
break
;
case
MCF_MINIMUM
:
REPLACE
(
pp
->
dyn_min
,
VSB_data
(
vsb
));
pp
->
min
=
pp
->
dyn_min
;
break
;
case
MCF_MAXIMUM
:
REPLACE
(
pp
->
dyn_max
,
VSB_data
(
vsb
));
pp
->
max
=
pp
->
dyn_max
;
break
;
default:
WRONG
(
"bad 'which'"
);
}
mcf_dyn_vsb
(
which
,
pp
,
vsb
);
VSB_delete
(
vsb
);
}
...
...
tools/lsan.suppr
View file @
aeead7e7
# varnishtest
leak:varnishtest
# pp->{def,min,max}
leak:MCF_ParamConf
# pp->{def,min,max}
leak:mcf_wash_param
# av
leak:STV_Config
# av
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment