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
92566707
Unverified
Commit
92566707
authored
Jan 01, 2024
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use TAKE_OBJ_NOTNULL and plug minor leaks - also appeases Flexelint
parent
3084655d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
8 deletions
+11
-8
vdfp_pipe.c
src/vdfp_pipe.c
+11
-8
No files found.
src/vdfp_pipe.c
View file @
92566707
...
...
@@ -536,7 +536,7 @@ vdp_fini(struct vdp_ctx *ctx, void **priv)
AN
(
priv
);
if
(
*
priv
==
NULL
)
return
(
0
);
CAST_OBJ
(
state
,
*
priv
,
PIPE_VDP_STATE_MAGIC
);
TAKE_OBJ_NOTNULL
(
state
,
priv
,
PIPE_VDP_STATE_MAGIC
);
CHECK_OBJ_NOTNULL
(
state
->
obj
,
PIPE_VDP_MAGIC
);
AN
(
state
->
obj
->
name
);
AN
(
state
->
obj
->
path
);
...
...
@@ -594,8 +594,11 @@ vmod_event(VRT_CTX, struct vmod_priv *priv, enum vcl_event_e e)
}
static
void
vdp_obj_free
(
VRT_CTX
,
struct
VPFX
(
pipe_vdp
)
*
vdp_obj
)
vdp_obj_free
(
VRT_CTX
,
struct
VPFX
(
pipe_vdp
)
*
*
vdp_objp
)
{
struct
VPFX
(
pipe_vdp
)
*
vdp_obj
;
TAKE_OBJ_NOTNULL
(
vdp_obj
,
vdp_objp
,
PIPE_VDP_MAGIC
);
free
(
vdp_obj
->
argv
);
if
(
ctx
!=
NULL
&&
vdp_obj
->
vdp
!=
NULL
)
VRT_RemoveFilter
(
ctx
,
NULL
,
vdp_obj
->
vdp
);
...
...
@@ -673,7 +676,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
);
vdp_obj_free
(
NULL
,
&
vdp_obj
);
return
;
}
vdp
->
name
=
strdup
(
vdp_name
);
...
...
@@ -681,19 +684,19 @@ vmod_vdp__init(VRT_CTX, struct VPFX(pipe_vdp) **vdpp, const char *obj_name,
vdp
->
bytes
=
vdp_bytes
;
vdp
->
fini
=
vdp_fini
;
// XXX free mem etc
vdp_obj
->
vdp
=
vdp
;
if
(
VRT_AddFilter
(
ctx
,
NULL
,
vdp
))
{
vdp_obj_free
(
NULL
,
vdp_obj
);
vdp_obj_free
(
NULL
,
&
vdp_obj
);
return
;
}
vdp_obj
->
vdp
=
vdp
;
errno
=
0
;
ALLOC_OBJ
(
map
,
PIPE_VDP_MAP_MAGIC
);
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
);
vdp_obj_free
(
ctx
,
&
vdp_obj
);
return
;
}
...
...
@@ -703,7 +706,7 @@ vmod_vdp__init(VRT_CTX, struct VPFX(pipe_vdp) **vdpp, const char *obj_name,
VDPFAIL
(
ctx
,
"new %s: cannot allocate argv: %s"
,
obj_name
,
VAS_errtxt
(
errno
));
FREE_OBJ
(
map
);
vdp_obj_free
(
ctx
,
vdp_obj
);
vdp_obj_free
(
ctx
,
&
vdp_obj
);
return
;
}
vdp_obj
->
argv
[
0
]
=
vdp_obj
->
path
;
...
...
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