Update port.c

32 bytes of dynamically allocated memory leaks in error scenario.