Only realloc if required

Signed-off-by: Michael Ikey Doherty <michael.i.doherty@intel.com>