avoid some leaks and NULL pointer derefs

This commit is contained in:
Wim Taymans 2020-06-08 11:15:53 +02:00
parent 2fd64f1591
commit dac60d4e5b
3 changed files with 8 additions and 1 deletions

View file

@ -132,8 +132,10 @@ static int alloc_buffers(struct pw_mempool *pool,
PW_MEMBLOCK_FLAG_MAP,
SPA_DATA_MemFd,
n_buffers * info.mem_size);
if (m == NULL)
if (m == NULL) {
free(buffers);
return -errno;
}
data = m->map->ptr;
} else {