mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-12-16 08:56:45 -05:00
make sure we call va_end in all cases
This commit is contained in:
parent
c2028a1695
commit
8123e271ec
2 changed files with 12 additions and 6 deletions
|
|
@ -1449,16 +1449,18 @@ int pw_filter_set_error(struct pw_filter *filter,
|
|||
if (res < 0) {
|
||||
va_list args;
|
||||
char *value;
|
||||
int r;
|
||||
|
||||
va_start(args, error);
|
||||
if (vasprintf(&value, error, args) < 0)
|
||||
r = vasprintf(&value, error, args);
|
||||
va_end(args);
|
||||
if (r < 0)
|
||||
return -errno;
|
||||
|
||||
if (filter->proxy)
|
||||
pw_proxy_error(filter->proxy, res, value);
|
||||
|
||||
filter_set_state(filter, PW_FILTER_STATE_ERROR, value);
|
||||
va_end(args);
|
||||
|
||||
free(value);
|
||||
}
|
||||
return res;
|
||||
|
|
|
|||
|
|
@ -1597,16 +1597,18 @@ int pw_stream_set_error(struct pw_stream *stream,
|
|||
if (res < 0) {
|
||||
va_list args;
|
||||
char *value;
|
||||
int r;
|
||||
|
||||
va_start(args, error);
|
||||
if (vasprintf(&value, error, args) < 0)
|
||||
r = vasprintf(&value, error, args);
|
||||
va_end(args);
|
||||
if (r < 0)
|
||||
return -errno;
|
||||
|
||||
if (stream->proxy)
|
||||
pw_proxy_error(stream->proxy, res, value);
|
||||
stream_set_state(stream, PW_STREAM_STATE_ERROR, value);
|
||||
|
||||
va_end(args);
|
||||
free(value);
|
||||
}
|
||||
return res;
|
||||
|
|
@ -1674,6 +1676,8 @@ int pw_stream_set_control(struct pw_stream *stream, uint32_t id, uint32_t n_valu
|
|||
}
|
||||
pod = spa_pod_builder_pop(&b, &f[0]);
|
||||
|
||||
va_end(varargs);
|
||||
|
||||
pw_impl_node_set_param(impl->node, SPA_PARAM_Props, 0, pod);
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue