In handle_connect(), the local pointer variable errctx is not
initialized. If an error occurs early in the function, for example
because recv_cred_buffer() fails, we jump to the "out" label and try
to print the string errctx points to. This will cause a segfault or
worse, so make sure the variable is always initialized.
This bug was found by the static analyzer of clang.
uid_t uid;
const struct lls_command *cmd;
struct lls_parse_result *lpr;
- char *errctx;
+ char *errctx = NULL;
const struct audiod_command_info *aci;
ret = para_accept(accept_fd, rfds, &unix_addr, sizeof(struct sockaddr_un), &clifd);