mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2026-05-08 12:06:40 -04:00
modules: handle allocation errors gracefully
This commit is contained in:
parent
24f9b9a335
commit
dd695ee5a7
6 changed files with 35 additions and 4 deletions
|
|
@ -1410,7 +1410,10 @@ static void parse_devices(struct impl *impl, const char *val, size_t len)
|
|||
impl->n_devices = 0;
|
||||
while (spa_json_get_string(&it[0], v, sizeof(v)) > 0 &&
|
||||
impl->n_devices < FFADO_MAX_SPECSTRINGS) {
|
||||
impl->devices[impl->n_devices++] = strdup(v);
|
||||
char *s = strdup(v);
|
||||
if (s == NULL)
|
||||
return;
|
||||
impl->devices[impl->n_devices++] = s;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue