All error handling paths of this function call 'apr_socket_close()' , except this one. So add it here too. Probably spotted with the help of the Coccinelle software (Thx Julia for the patch and for Coccinelle) See PR 53015