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);