Fix some leaks in error cases

This commit is contained in:
Wim Taymans 2020-05-20 14:05:42 +02:00
parent 8669fd03a6
commit c2028a1695
9 changed files with 43 additions and 22 deletions

View file

@ -210,8 +210,10 @@ pw_client_node0_transport_new(struct pw_context *context,
PW_MEMBLOCK_FLAG_MAP |
PW_MEMBLOCK_FLAG_SEAL,
SPA_DATA_MemFd, area_get_size(&area));
if (impl->mem == NULL)
if (impl->mem == NULL) {
free(impl);
return NULL;
}
memcpy(impl->mem->map->ptr, &area, sizeof(struct pw_client_node0_area));
transport_setup_area(impl->mem->map->ptr, trans);

View file

@ -95,6 +95,7 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
props,
sizeof(struct device_data));
if (device == NULL) {
props = NULL;
res = -errno;
goto error_exit_cleanup;
}
@ -119,5 +120,7 @@ error_arguments:
error_exit_cleanup:
if (argv)
pw_free_strv(argv);
if (props)
pw_properties_free(props);
return res;
}