parent
84b4d2cdb5
commit
751e541776
|
@ -5,7 +5,11 @@
|
|||
int uh_buf_init(struct uh_buf *buf, size_t initial_size)
|
||||
{
|
||||
buf->len = buf->size = 0;
|
||||
buf->base = NULL;
|
||||
|
||||
if (buf->base) {
|
||||
free(buf->base);
|
||||
buf->base = NULL;
|
||||
}
|
||||
|
||||
if (initial_size > 0) {
|
||||
buf->base = malloc(initial_size);
|
||||
|
|
Loading…
Reference in New Issue