pcm_buffer: set size after allocation
When I implemented the pcm_buffer library, I forgot to set the new buffer size. This caused a new allocation in each pcm_buffer_get(), fortunately no memory was leaked.
This commit is contained in:
parent
d8db46edfa
commit
ac3e2de28b
@ -65,7 +65,8 @@ pcm_buffer_get(struct pcm_buffer *buffer, size_t size)
|
||||
g_free(buffer->buffer);
|
||||
|
||||
/* allocate a new buffer; align at 64kB boundaries */
|
||||
buffer->buffer = g_malloc((size | 0xffff) + 1);
|
||||
buffer->size = (size | 0xffff) + 1;
|
||||
buffer->buffer = g_malloc(buffer->size);
|
||||
}
|
||||
|
||||
return buffer->buffer;
|
||||
|
Loading…
Reference in New Issue
Block a user