Skip to content

Commit 98c2924

Browse files
Clemens Buchachergitster
authored andcommitted
credentials: unable to connect to cache daemon
Error out if we just spawned the daemon and yet we cannot connect. And always release the string buffer. Signed-off-by: Clemens Buchacher <[email protected]> Acked-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 861444f commit 98c2924

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

credential-cache.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,10 @@ static void do_cache(const char *socket, const char *action, int timeout,
7171
die_errno("unable to relay credential");
7272
}
7373

74-
if (!send_request(socket, &buf))
75-
return;
76-
if (flags & FLAG_SPAWN) {
74+
if (send_request(socket, &buf) < 0 && (flags & FLAG_SPAWN)) {
7775
spawn_daemon(socket);
78-
send_request(socket, &buf);
76+
if (send_request(socket, &buf) < 0)
77+
die_errno("unable to connect to cache daemon");
7978
}
8079
strbuf_release(&buf);
8180
}

0 commit comments

Comments
 (0)