[PATCH 2/6 v2] reg: Use realloc() instead of heap_xrealloc()