summaryrefslogtreecommitdiffstats
path: root/src/sdp.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2005-09-22 23:10:48 +0000
committerMarcel Holtmann <marcel@holtmann.org>2005-09-22 23:10:48 +0000
commit12862715c961bf6dabce2ed4e58da58e5dfe8c6b (patch)
tree338a768117c0738d963024169dff4c22435428dd /src/sdp.c
parentc15d73bdb64196dee440476b5c3c031ee52c2373 (diff)
Fix errno overwrite problems
Diffstat (limited to 'src/sdp.c')
-rw-r--r--src/sdp.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/sdp.c b/src/sdp.c
index 0198f9ec..56c74d49 100644
--- a/src/sdp.c
+++ b/src/sdp.c
@@ -3160,6 +3160,7 @@ static inline int sdp_is_local(const bdaddr_t *device)
sdp_session_t *sdp_connect(const bdaddr_t *src, const bdaddr_t *dst, uint32_t flags)
{
+ int err;
sdp_session_t *session = malloc(sizeof(sdp_session_t));
if (!session)
return session;
@@ -3204,8 +3205,10 @@ sdp_session_t *sdp_connect(const bdaddr_t *src, const bdaddr_t *dst, uint32_t fl
}
}
fail:
+ err = errno;
if (session->sock >= 0)
close(session->sock);
free(session);
+ errno = err;
return 0;
}