summaryrefslogtreecommitdiff
path: root/regenc.c
diff options
context:
space:
mode:
Diffstat (limited to 'regenc.c')
-rw-r--r--regenc.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/regenc.c b/regenc.c
index c8f317c8d9..de768efd72 100644
--- a/regenc.c
+++ b/regenc.c
@@ -902,13 +902,15 @@ resize_property_list(int new_size, const OnigCodePoint*** plist, int* psize)
size = sizeof(OnigCodePoint*) * new_size;
if (IS_NULL(list)) {
list = (const OnigCodePoint** )xmalloc(size);
+ if (IS_NULL(list)) return ONIGERR_MEMORY;
}
else {
- list = (const OnigCodePoint** )xrealloc((void* )list, size);
+ const OnigCodePoint **tmp;
+ tmp = (const OnigCodePoint** )xrealloc((void* )list, size);
+ if (IS_NULL(tmp)) return ONIGERR_MEMORY;
+ list = tmp;
}
- if (IS_NULL(list)) return ONIGERR_MEMORY;
-
*plist = list;
*psize = new_size;