module-device-factory: clean up properties in all cases

This commit is contained in:
Wim Taymans 2020-12-03 10:24:38 +01:00
parent e98931023f
commit 3005d33113

View file

@ -166,7 +166,7 @@ error_properties:
if (resource)
pw_resource_errorf_id(resource, new_id, res,
"usage: "FACTORY_USAGE);
goto error_exit;
goto error_exit_cleanup;
error_device:
pw_log_debug("can't create device %s: %s", factory_name, spa_strerror(res));
if (resource)
@ -178,6 +178,10 @@ error_bind:
pw_resource_errorf_id(resource, new_id, res, "can't bind device");
pw_impl_device_destroy(device);
goto error_exit;
error_exit_cleanup:
if (properties)
pw_properties_free(properties);
error_exit:
free(factory_name);
errno = -res;