Fix realloc
Merge pull request #340 from iabdalkader/realloc

Fix realloc