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) {
|
if (res < 0) {
|
||||||
va_list args;
|
va_list args;
|
||||||
char *value;
|
char *value;
|
||||||
|
int r;
|
||||||
|
|
||||||
va_start(args, error);
|
va_start(args, error);
|
||||||
if (vasprintf(&value, error, args) < 0)
|
r = vasprintf(&value, error, args);
|
||||||
|
va_end(args);
|
||||||
|
if (r < 0)
|
||||||
return -errno;
|
return -errno;
|
||||||
|
|
||||||
if (filter->proxy)
|
if (filter->proxy)
|
||||||
pw_proxy_error(filter->proxy, res, value);
|
pw_proxy_error(filter->proxy, res, value);
|
||||||
|
|
||||||
filter_set_state(filter, PW_FILTER_STATE_ERROR, value);
|
filter_set_state(filter, PW_FILTER_STATE_ERROR, value);
|
||||||
va_end(args);
|
|
||||||
free(value);
|
free(value);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
|
|
||||||
|
|
@ -1597,16 +1597,18 @@ int pw_stream_set_error(struct pw_stream *stream,
|
||||||
if (res < 0) {
|
if (res < 0) {
|
||||||
va_list args;
|
va_list args;
|
||||||
char *value;
|
char *value;
|
||||||
|
int r;
|
||||||
|
|
||||||
va_start(args, error);
|
va_start(args, error);
|
||||||
if (vasprintf(&value, error, args) < 0)
|
r = vasprintf(&value, error, args);
|
||||||
|
va_end(args);
|
||||||
|
if (r < 0)
|
||||||
return -errno;
|
return -errno;
|
||||||
|
|
||||||
if (stream->proxy)
|
if (stream->proxy)
|
||||||
pw_proxy_error(stream->proxy, res, value);
|
pw_proxy_error(stream->proxy, res, value);
|
||||||
stream_set_state(stream, PW_STREAM_STATE_ERROR, value);
|
stream_set_state(stream, PW_STREAM_STATE_ERROR, value);
|
||||||
|
|
||||||
va_end(args);
|
|
||||||
free(value);
|
free(value);
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
|
@ -1640,7 +1642,7 @@ int pw_stream_set_control(struct pw_stream *stream, uint32_t id, uint32_t n_valu
|
||||||
struct spa_pod *pod;
|
struct spa_pod *pod;
|
||||||
struct control *c;
|
struct control *c;
|
||||||
|
|
||||||
va_start(varargs, values);
|
va_start(varargs, values);
|
||||||
|
|
||||||
spa_pod_builder_push_object(&b, &f[0], SPA_TYPE_OBJECT_Props, SPA_PARAM_Props);
|
spa_pod_builder_push_object(&b, &f[0], SPA_TYPE_OBJECT_Props, SPA_PARAM_Props);
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
@ -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]);
|
pod = spa_pod_builder_pop(&b, &f[0]);
|
||||||
|
|
||||||
|
va_end(varargs);
|
||||||
|
|
||||||
pw_impl_node_set_param(impl->node, SPA_PARAM_Props, 0, pod);
|
pw_impl_node_set_param(impl->node, SPA_PARAM_Props, 0, pod);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue