Added more error checking to readconn.c

Added code to readconn.c to properly free memory when error
conditions are met