Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Peter Hutterer
pipewire
Commits
d4d6458b
Commit
d4d6458b
authored
Nov 19, 2021
by
Peter Hutterer
Browse files
modules: check for a NULL resource in client-device and client-node
See
pipewire/wireplumber#113
parent
31a84a8d
Pipeline
#449418
passed with stages
in 5 minutes and 3 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
src/modules/module-client-device.c
View file @
d4d6458b
...
...
@@ -75,9 +75,15 @@ static void *create_object(void *_data,
struct
pw_impl_factory
*
this
=
data
->
this
;
void
*
result
;
struct
pw_resource
*
device_resource
;
struct
pw_impl_client
*
client
=
pw_resource_get_client
(
resource
)
;
struct
pw_impl_client
*
client
;
int
res
;
if
(
resource
==
NULL
)
{
res
=
-
EINVAL
;
goto
error_exit
;
}
client
=
pw_resource_get_client
(
resource
);
device_resource
=
pw_resource_new
(
client
,
new_id
,
PW_PERM_ALL
,
type
,
version
,
0
);
if
(
device_resource
==
NULL
)
{
res
=
-
errno
;
...
...
src/modules/module-client-node.c
View file @
d4d6458b
...
...
@@ -77,9 +77,15 @@ static void *create_object(void *_data,
{
void
*
result
;
struct
pw_resource
*
node_resource
;
struct
pw_impl_client
*
client
=
pw_resource_get_client
(
resource
)
;
struct
pw_impl_client
*
client
;
int
res
;
if
(
resource
==
NULL
)
{
res
=
-
EINVAL
;
goto
error_exit
;
}
client
=
pw_resource_get_client
(
resource
);
node_resource
=
pw_resource_new
(
client
,
new_id
,
PW_PERM_ALL
,
type
,
version
,
0
);
if
(
node_resource
==
NULL
)
{
res
=
-
errno
;
...
...
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