Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
libvdfp-pipe
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
libvdfp-pipe
Commits
aa44f00e
Unverified
Commit
aa44f00e
authored
Jan 25, 2022
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Plug minor leaks for failures in vmod_vdp__init()
parent
3a3ae9bb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
5 deletions
+24
-5
vdfp_pipe.c
src/vdfp_pipe.c
+24
-5
No files found.
src/vdfp_pipe.c
View file @
aa44f00e
...
...
@@ -581,6 +581,19 @@ vmod_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
NEEDLESS
(
return
(
0
));
}
static
void
vdp_obj_free
(
VRT_CTX
,
struct
VPFX
(
pipe_vdp
)
*
vdp_obj
)
{
free
(
vdp_obj
->
argv
);
if
(
ctx
!=
NULL
&&
vdp_obj
->
vdp
!=
NULL
)
VRT_RemoveFilter
(
ctx
,
NULL
,
vdp_obj
->
vdp
);
free
(
TRUST_ME
(
vdp_obj
->
vdp
->
name
));
free
(
vdp_obj
->
vdp
);
free
(
vdp_obj
->
path
);
free
(
vdp_obj
->
name
);
FREE_OBJ
(
vdp_obj
);
}
/* vdp object */
VCL_VOID
...
...
@@ -637,7 +650,6 @@ vmod_vdp__init(VRT_CTX, struct VPFX(pipe_vdp) **vdpp, const char *obj_name,
obj_name
,
VAS_errtxt
(
errno
));
return
;
}
*
vdpp
=
vdp_obj
;
vdp_obj
->
name
=
strdup
(
obj_name
);
vdp_obj
->
path
=
strdup
(
path
);
vdp_obj
->
bufsz
=
bufsz
;
...
...
@@ -649,6 +661,7 @@ vmod_vdp__init(VRT_CTX, struct VPFX(pipe_vdp) **vdpp, const char *obj_name,
if
(
vdp
==
NULL
)
{
VDPFAIL
(
ctx
,
"new %s: cannot allocate space for VDP: %s"
,
obj_name
,
VAS_errtxt
(
errno
));
vdp_obj_free
(
NULL
,
vdp_obj
);
return
;
}
vdp
->
name
=
strdup
(
vdp_name
);
...
...
@@ -658,6 +671,7 @@ vmod_vdp__init(VRT_CTX, struct VPFX(pipe_vdp) **vdpp, const char *obj_name,
// XXX free mem etc
if
(
VRT_AddFilter
(
ctx
,
NULL
,
vdp
))
{
vdp_obj_free
(
NULL
,
vdp_obj
);
return
;
}
vdp_obj
->
vdp
=
vdp
;
...
...
@@ -667,24 +681,29 @@ vmod_vdp__init(VRT_CTX, struct VPFX(pipe_vdp) **vdpp, const char *obj_name,
if
(
map
==
NULL
)
{
VDPFAIL
(
ctx
,
"new %s: cannot allocate space for map entry: %s"
,
obj_name
,
VAS_errtxt
(
errno
));
vdp_obj_free
(
ctx
,
vdp_obj
);
return
;
}
map
->
vdp
=
vdp
;
map
->
vcl
=
ctx
->
vcl
;
map
->
obj
=
vdp_obj
;
AZ
(
VRBT_INSERT
(
vdp_tree
,
&
tree_h
,
map
));
errno
=
0
;
vdp_obj
->
argv
=
malloc
(
2
*
sizeof
(
*
vdp_obj
->
argv
));
if
(
vdp_obj
->
argv
==
NULL
)
{
VDPFAIL
(
ctx
,
"new %s: cannot allocate argv: %s"
,
obj_name
,
VAS_errtxt
(
errno
));
FREE_OBJ
(
map
);
vdp_obj_free
(
ctx
,
vdp_obj
);
return
;
}
vdp_obj
->
argv
[
0
]
=
vdp_obj
->
path
;
vdp_obj
->
argv
[
1
]
=
NULL
;
vdp_obj
->
argc
=
1
;
map
->
vdp
=
vdp
;
map
->
vcl
=
ctx
->
vcl
;
map
->
obj
=
vdp_obj
;
AZ
(
VRBT_INSERT
(
vdp_tree
,
&
tree_h
,
map
));
*
vdpp
=
vdp_obj
;
return
;
}
...
...
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