[trunk] solve a potential bug when we test the realloc