Yes, that should be fine - well, no memory leaks anyway.

Though later on, you might want to introduce a 'maxsize' as well, so you can re-use the buffer if newsize <= maxsize