From: Andre Noll Date: Sun, 10 Oct 2010 16:51:17 +0000 (+0200) Subject: Minor makesock() fixes. X-Git-Tag: v0.4.5~9 X-Git-Url: http://git.tuebingen.mpg.de/?p=paraslash.git;a=commitdiff_plain;h=e5f02e0748de02eabfb8e0746af09eb676ec1dc0;hp=e5f02e0748de02eabfb8e0746af09eb676ec1dc0 Minor makesock() fixes. On getaddrinfo() or setsockopt() errors, we leak the flowopts and/or the local/remote address info structure. Fix this by jumping to the cleanup section at the bottom of makesock() rather than returning early without cleaning up. Moreover, we can not rely on errno containing a valid error code in the cleanup part of the function because flowopt_cleanup() calls free() which usually resets errno. So use the error code provided via "rc" if possible and fall back to the new -E_MAKESOCK if rc is non-negative to make sure we return a negative value on errors. ---