Fixed wrong realloc usage - valgrind says "0 errors"