Skip to content

Commit

Permalink
apps/restconf: fix compiler warning 'addr' may be used uninitialized
Browse files Browse the repository at this point in the history
Natvie build with GCC 11.3 generates the following warning.  The patch
is silly and the code path should never be reached, but it silences the
compiler.

restconf_main_native.c:572:9: warning: ‘addr’ may be used uninitialized in this function [-Wmaybe-uninitialized]

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
  • Loading branch information
troglobit committed Feb 8, 2023
1 parent 265bd02 commit 078c6db
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apps/restconf/restconf_main_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -564,6 +564,9 @@ restconf_accept_client(int fd,
addr = &(in6->sin6_addr);
break;
}
default:
errno = EAFNOSUPPORT;
goto done;
}
if ((rsock->rs_from_addr = calloc(INET6_ADDRSTRLEN, 1)) == NULL){
clicon_err(OE_UNIX, errno, "calloc");
Expand Down

0 comments on commit 078c6db

Please sign in to comment.