Update port.c

32 bytes of dynamically allocated memory leaks in error scenario.
Merge pull request #9 from vchandla/patch-2

Update port.c