direct session backend: fix closing -1 on error

Found through static analysis
master
Dominique Martinet 6 years ago
parent 1e17f4deb6
commit 266898ca1f

@ -159,7 +159,9 @@ static void communicate(int sock) {
} }
error: error:
send_msg(sock, ret ? -1 : fd, &ret, sizeof(ret)); send_msg(sock, ret ? -1 : fd, &ret, sizeof(ret));
close(fd); if (fd >= 0) {
close(fd);
}
break; break;

Loading…
Cancel
Save