diff options
author | Michael Tatarinov <kukabu@gmail.com> | 2011-06-27 10:34:28 +0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-06-27 02:36:56 -0400 |
commit | 5ab7d662b32628f6e198f2d43c1030a0a852e07f (patch) | |
tree | 4dae9933fa06f8b45295951aa39016275de4e8ca /netlib.c | |
parent | 4864719b1e1b83601999fe82bd0dd3b32534efe4 (diff) | |
download | gpsd-5ab7d662b32628f6e198f2d43c1030a0a852e07f.tar.gz |
netlib_localsocket(): close the socket if connect() failed
Signed-off-by: Eric S. Raymond <esr@thyrsus.com>
Diffstat (limited to 'netlib.c')
-rw-r--r-- | netlib.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -165,6 +165,7 @@ socket_t netlib_localsocket(const char *sockfile) /*@-unrecog@*/ if (connect(sock, (struct sockaddr *)&saddr, SUN_LEN(&saddr)) < 0) { + (void)close(sock); return -1; } /*@+unrecog@*/ |