The process_client_msg() function could return an error but no
sock_error. In any case, we have to close the socket since a TODO is
still there indicating that we need to reply to the client to inform of
the error.
Issue
1019920 of coverity scan.
Signed-off-by: David Goulet <dgoulet@efficios.com>
ret = process_client_msg(cmd_ctx, sock, &sock_error);
rcu_thread_offline();
if (ret < 0) {
- if (sock_error) {
- ret = close(sock);
- if (ret) {
- PERROR("close");
- }
- sock = -1;
+ ret = close(sock);
+ if (ret) {
+ PERROR("close");
}
+ sock = -1;
/*
* TODO: Inform client somehow of the fatal error. At
* this point, ret < 0 means that a zmalloc failed