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
698a4742
Unverified
Commit
698a4742
authored
Jan 10, 2021
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vcc: Plug more insignificant leaks
Coverity CID 1362617, CID 1362625, CID 1362626, CID 1362627
parent
e9576081
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
19 deletions
+18
-19
vcc_acl.c
lib/libvcc/vcc_acl.c
+3
-1
vcc_backend.c
lib/libvcc/vcc_backend.c
+15
-18
No files found.
lib/libvcc/vcc_acl.c
View file @
698a4742
...
@@ -194,8 +194,10 @@ vcc_acl_add_entry(struct vcc *tl, const struct acl_e *ae, int l,
...
@@ -194,8 +194,10 @@ vcc_acl_add_entry(struct vcc *tl, const struct acl_e *ae, int l,
* If the two rules agree, silently ignore it
* If the two rules agree, silently ignore it
* XXX: is that counter intuitive ?
* XXX: is that counter intuitive ?
*/
*/
if
(
aen
->
not
==
ae2
->
not
)
if
(
aen
->
not
==
ae2
->
not
)
{
free
(
aen
);
return
;
return
;
}
VSB_cat
(
tl
->
sb
,
"Conflicting ACL entries:
\n
"
);
VSB_cat
(
tl
->
sb
,
"Conflicting ACL entries:
\n
"
);
vcc_ErrWhere
(
tl
,
ae2
->
t_addr
);
vcc_ErrWhere
(
tl
,
ae2
->
t_addr
);
VSB_cat
(
tl
->
sb
,
"vs:
\n
"
);
VSB_cat
(
tl
->
sb
,
"vs:
\n
"
);
...
...
lib/libvcc/vcc_backend.c
View file @
698a4742
...
@@ -149,15 +149,15 @@ vcc_Redef(struct vcc *tl, const char *redef, struct token **t_did,
...
@@ -149,15 +149,15 @@ vcc_Redef(struct vcc *tl, const char *redef, struct token **t_did,
*/
*/
static
void
static
void
vcc_ParseProbeSpec
(
struct
vcc
*
tl
,
const
struct
symbol
*
sym
,
char
**
name
)
vcc_ParseProbeSpec
(
struct
vcc
*
tl
,
const
struct
symbol
*
sym
,
char
**
name
p
)
{
{
struct
fld_spec
*
fs
;
struct
fld_spec
*
fs
;
struct
token
*
t_field
;
struct
token
*
t_field
;
struct
token
*
t_did
=
NULL
,
*
t_window
=
NULL
,
*
t_threshold
=
NULL
;
struct
token
*
t_did
=
NULL
,
*
t_window
=
NULL
,
*
t_threshold
=
NULL
;
struct
token
*
t_initial
=
NULL
;
struct
token
*
t_initial
=
NULL
;
struct
vsb
*
vsb
;
char
*
retval
;
unsigned
window
,
threshold
,
initial
,
status
;
unsigned
window
,
threshold
,
initial
,
status
;
char
buf
[
32
];
const
char
*
name
;
double
t
;
double
t
;
fs
=
vcc_FldSpec
(
tl
,
fs
=
vcc_FldSpec
(
tl
,
...
@@ -173,25 +173,21 @@ vcc_ParseProbeSpec(struct vcc *tl, const struct symbol *sym, char **name)
...
@@ -173,25 +173,21 @@ vcc_ParseProbeSpec(struct vcc *tl, const struct symbol *sym, char **name)
SkipToken
(
tl
,
'{'
);
SkipToken
(
tl
,
'{'
);
vsb
=
VSB_new_auto
();
if
(
sym
!=
NULL
)
{
AN
(
vsb
);
name
=
sym
->
rname
;
if
(
sym
!=
NULL
)
}
else
{
VSB_cat
(
vsb
,
sym
->
rname
);
bprintf
(
buf
,
"vgc_probe__%d"
,
tl
->
nprobe
++
);
else
name
=
buf
;
VSB_printf
(
vsb
,
"vgc_probe__%d"
,
tl
->
nprobe
++
);
}
AZ
(
VSB_finish
(
vsb
));
Fh
(
tl
,
0
,
"static const struct vrt_backend_probe %s[] = {{
\n
"
,
name
);
retval
=
TlDup
(
tl
,
VSB_data
(
vsb
));
Fh
(
tl
,
0
,
"
\t
.magic = VRT_BACKEND_PROBE_MAGIC,
\n
"
);
AN
(
retval
);
if
(
namep
!=
NULL
)
VSB_destroy
(
&
vsb
);
*
namep
=
TlDup
(
tl
,
name
);
if
(
name
!=
NULL
)
*
name
=
retval
;
window
=
0
;
window
=
0
;
threshold
=
0
;
threshold
=
0
;
initial
=
0
;
initial
=
0
;
status
=
0
;
status
=
0
;
Fh
(
tl
,
0
,
"static const struct vrt_backend_probe %s[] = {{
\n
"
,
retval
);
Fh
(
tl
,
0
,
"
\t
.magic = VRT_BACKEND_PROBE_MAGIC,
\n
"
);
while
(
tl
->
t
->
tok
!=
'}'
)
{
while
(
tl
->
t
->
tok
!=
'}'
)
{
vcc_IsField
(
tl
,
&
t_field
,
fs
);
vcc_IsField
(
tl
,
&
t_field
,
fs
);
...
@@ -323,7 +319,7 @@ vcc_ParseProbe(struct vcc *tl)
...
@@ -323,7 +319,7 @@ vcc_ParseProbe(struct vcc *tl)
sym
=
VCC_HandleSymbol
(
tl
,
PROBE
,
"vgc_probe"
);
sym
=
VCC_HandleSymbol
(
tl
,
PROBE
,
"vgc_probe"
);
ERRCHK
(
tl
);
ERRCHK
(
tl
);
AN
(
sym
);
AN
(
sym
);
vcc_ParseProbeSpec
(
tl
,
sym
,
&
p
);
vcc_ParseProbeSpec
(
tl
,
sym
,
NULL
);
}
}
}
}
...
@@ -480,6 +476,7 @@ vcc_ParseHostDef(struct vcc *tl, const struct token *t_be, const char *vgcname)
...
@@ -480,6 +476,7 @@ vcc_ParseHostDef(struct vcc *tl, const struct token *t_be, const char *vgcname)
}
else
if
(
vcc_IdIs
(
t_field
,
"probe"
)
&&
tl
->
t
->
tok
==
'{'
)
{
}
else
if
(
vcc_IdIs
(
t_field
,
"probe"
)
&&
tl
->
t
->
tok
==
'{'
)
{
vcc_ParseProbeSpec
(
tl
,
NULL
,
&
p
);
vcc_ParseProbeSpec
(
tl
,
NULL
,
&
p
);
Fb
(
tl
,
0
,
"
\t
.probe = %s,
\n
"
,
p
);
Fb
(
tl
,
0
,
"
\t
.probe = %s,
\n
"
,
p
);
free
(
p
);
ERRCHK
(
tl
);
ERRCHK
(
tl
);
}
else
if
(
vcc_IdIs
(
t_field
,
"probe"
)
&&
tl
->
t
->
tok
==
ID
)
{
}
else
if
(
vcc_IdIs
(
t_field
,
"probe"
)
&&
tl
->
t
->
tok
==
ID
)
{
if
(
vcc_IdIs
(
tl
->
t
,
"default"
))
{
if
(
vcc_IdIs
(
tl
->
t
,
"default"
))
{
...
...
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