audiod: Avoid uninitialized memory access.
authorAndre Noll <maan@tuebingen.mpg.de>
Fri, 21 Apr 2017 18:43:06 +0000 (20:43 +0200)
committerAndre Noll <maan@tuebingen.mpg.de>
Fri, 21 Apr 2017 18:43:06 +0000 (20:43 +0200)
commitb8b85c39eadee1d42857ee7ce31f2a1e04967024
tree9bb334aac3bdd62b70be8649f91fcc26fbf81567
parente413873ec15efc84366e747d3c5d48293b959c1f
audiod: Avoid uninitialized memory access.

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.
audiod_command.c