Skip to content

Commit

Permalink
fixed handling error cases
Browse files Browse the repository at this point in the history
fixes CID 443645, thanks coverity scan
  • Loading branch information
frankmorgner committed Sep 9, 2024
1 parent 0072307 commit ffea1e0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions virtualsmartcard/src/vpcd/vpcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ int vicc_eject(struct vicc_ctx *ctx)
int r = 0;
if (ctx && ctx->client_sock != INVALID_SOCKET) {
if (close(ctx->client_sock) < 0) {
r -= 1;
r = -1;
}
ctx->client_sock = INVALID_SOCKET;
}
Expand Down Expand Up @@ -347,7 +347,7 @@ int vicc_exit(struct vicc_ctx *ctx)
if (ctx->server_sock != INVALID_SOCKET) {
ctx->server_sock = close(ctx->server_sock);
if (ctx->server_sock == INVALID_SOCKET) {
r -= 1;
r = -1;
}
}
free(ctx);
Expand Down

0 comments on commit ffea1e0

Please sign in to comment.