diff options
Diffstat (limited to 'regenc.c')
-rw-r--r-- | regenc.c | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -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; |