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

@ -619,7 +619,9 @@ static int add_int(struct format_info *info, const char *k, struct spa_pod *para
size_t size;
FILE *f;
f = open_memstream(&ptr, &size);
if ((f = open_memstream(&ptr, &size)) == NULL)
return -errno;
fprintf(f, "[");
for (i = 1; i < n_values; i++)
fprintf(f, "%s %d", i == 1 ? "" : ",", values[i]);