realloc can handle the case that its first parameter is NULL. Signed-off-by: Zhang Zhaolong <zhangzl2013@126.com>