From b047eda1cbd9c8c1345c610b7ac236867b908cc6 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 26 Jul 2016 04:53:25 -0700 Subject: Avoid passing NULL to a parameter that must not be NULL --- Alc/helpers.c | 5 +++-- 1 file 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; -- cgit v1.2.3