aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Alc/helpers.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Alc/helpers.c b/Alc/helpers.c
index bd345b6a..e065b022 100644
--- a/Alc/helpers.c
+++ b/Alc/helpers.c
@@ -858,8 +858,9 @@ ALboolean vector_reserve(char *ptr, size_t base_size, size_t obj_size, size_t ob
* sizeof(*vector_) may not equal base_size). */
temp = al_calloc(16, base_size + obj_size*obj_count);
if(temp == NULL) return AL_FALSE;
- memcpy(((ALubyte*)temp)+base_size, ((ALubyte*)*vecptr)+base_size,
- obj_size*old_size);
+ if(*vecptr)
+ memcpy(((ALubyte*)temp)+base_size, ((ALubyte*)*vecptr)+base_size,
+ obj_size*old_size);
al_free(*vecptr);
*vecptr = temp;