1
0
mirror of https://gitlab.xiph.org/xiph/icecast-server.git synced 2024-11-03 04:17:17 -05:00

Fix: Corrected memory allocator

This commit is contained in:
Philipp Schafft 2020-10-04 10:45:51 +00:00
parent 4cab251919
commit 7b5f52d77d

View File

@ -48,6 +48,9 @@ static int allocate_buffer(json_renderer_t *renderer, size_t needed)
if (!renderer->valid)
return 1;
if (have)
have--;
if (have < required) {
size_t want;
char *n;
@ -65,6 +68,7 @@ static int allocate_buffer(json_renderer_t *renderer, size_t needed)
return 1;
renderer->buffer = n;
renderer->bufferlen = want;
}
return 0;