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:
parent
4cab251919
commit
7b5f52d77d
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user