handle open_memstream errors

Fixes #2182
This commit is contained in:
Wim Taymans 2022-03-02 11:48:31 +01:00
parent fdaf4613d8
commit 99f9f729ff
21 changed files with 70 additions and 21 deletions

View file

@ -252,7 +252,9 @@ static int do_extension_stream_restore_write(struct client *client, uint32_t com
if (name == NULL || name[0] == '\0')
return -EPROTO;
f = open_memstream(&ptr, &size);
if ((f = open_memstream(&ptr, &size)) == NULL)
return -errno;
fprintf(f, "{");
fprintf(f, " \"mute\": %s", mute ? "true" : "false");
if (vol.channels > 0) {