Fix segmentation fault for aborted connections