This commit is contained in:
iceman1001 committed 2019-04-17 14:54:42 +02:00
1 parent da2aa2c55f
commit 1ee3679a98
6 files changed
+45 -55

No files matched your search

+3 -3
View File
@@ -65,15 +65,15 @@ static RetType write_to_buffer(void *cookie, const char *data, LenType len) {
if (newsize >= b->alloc) { // NB! one extra byte is needed to avoid buffer overflow at close_buffer
// make room
size_t newalloc = newsize + newsize / 2 + 1; // give 50% more room
char *tmp = realloc(ptr, newalloc);
if ( tmp == NULL ) {
if (tmp == NULL) {
free(ptr);
return -1;
} else {
ptr = tmp;
}
b->alloc = newalloc;
*b->ptr = ptr;
}