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
6ca33ca0
Commit
6ca33ca0
authored
Aug 08, 2020
by
Geoff Simmons
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use WS_Copy() for task-scoped .arg() rather than strdup().
parent
4d0710d4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
8 deletions
+13
-8
vdfp_pipe.c
src/vdfp_pipe.c
+13
-8
No files found.
src/vdfp_pipe.c
View file @
6ca33ca0
...
...
@@ -672,11 +672,8 @@ task_free(void *p)
struct
task_cfg
*
task
;
CAST_OBJ_NOTNULL
(
task
,
p
,
PIPE_TASK_MAGIC
);
if
(
task
->
argv
!=
NULL
)
{
for
(
int
i
=
1
;
task
->
argv
[
i
]
!=
NULL
;
i
++
)
free
(
task
->
argv
[
i
]);
if
(
task
->
argv
!=
NULL
)
free
(
task
->
argv
);
}
}
VCL_VOID
...
...
@@ -720,8 +717,8 @@ vmod_vdp_arg(VRT_CTX, struct VPFX(pipe_vdp) *obj, VCL_STRING arg)
AN
(
priv
);
if
(
priv
->
priv
==
NULL
)
{
if
((
priv
->
priv
=
WS_Alloc
(
ctx
->
ws
,
sizeof
(
*
task
)))
==
NULL
)
{
VDPFAIL
(
ctx
,
"%s.arg():
cannot allocate task config"
,
obj
->
name
);
VDPFAIL
(
ctx
,
"%s.arg():
insufficient workspace for "
"task config"
,
obj
->
name
);
return
;
}
task
=
(
struct
task_cfg
*
)
priv
->
priv
;
...
...
@@ -732,8 +729,12 @@ vmod_vdp_arg(VRT_CTX, struct VPFX(pipe_vdp) *obj, VCL_STRING arg)
obj
->
name
,
vstrerror
(
errno
));
return
;
}
if
((
task
->
argv
[
1
]
=
WS_Copy
(
ctx
->
ws
,
arg
,
-
1
))
==
NULL
)
{
VDPFAIL
(
ctx
,
"%s.arg(): insufficient workspace for %s"
,
obj
->
name
,
arg
);
return
;
}
task
->
argv
[
0
]
=
obj
->
path
;
task
->
argv
[
1
]
=
strdup
(
arg
);
task
->
argv
[
2
]
=
NULL
;
task
->
argc
=
2
;
task
->
magic
=
PIPE_TASK_MAGIC
;
...
...
@@ -754,7 +755,11 @@ vmod_vdp_arg(VRT_CTX, struct VPFX(pipe_vdp) *obj, VCL_STRING arg)
vstrerror
(
errno
));
return
;
}
task
->
argv
[
task
->
argc
]
=
strdup
(
arg
);
if
((
task
->
argv
[
task
->
argc
]
=
WS_Copy
(
ctx
->
ws
,
arg
,
-
1
))
==
NULL
)
{
VDPFAIL
(
ctx
,
"%s.arg(): insufficient workspace for %s"
,
obj
->
name
,
arg
);
return
;
}
task
->
argv
[
task
->
argc
+
1
]
=
NULL
;
task
->
argc
++
;
...
...
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