mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-06 13:30:01 -05:00
spa: add spa_aprintf helper
Add a asprintf helper function that handles errors correctly. Use this in places where we use asprintf to avoid warnings when we don't check the return value.
This commit is contained in:
parent
aee3191bad
commit
6ac9b7b3a7
16 changed files with 102 additions and 85 deletions
|
|
@ -322,12 +322,12 @@ rd_device_new(DBusConnection *connection, const char *device_name, const char *a
|
|||
|
||||
d->application_name = strdup(application_name);
|
||||
|
||||
asprintf(&d->object_path, OBJECT_PREFIX "%s", device_name);
|
||||
d->object_path = spa_aprintf(OBJECT_PREFIX "%s", device_name);
|
||||
if (d->object_path == NULL) {
|
||||
res = -errno;
|
||||
goto error_free;
|
||||
}
|
||||
asprintf(&d->service_name, SERVICE_PREFIX "%s", device_name);
|
||||
d->service_name = spa_aprintf(SERVICE_PREFIX "%s", device_name);
|
||||
if (d->service_name == NULL) {
|
||||
res = -errno;
|
||||
goto error_free;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue