switch-on-connect: Initialize userdata contents to zero

This fixes userdata.only_from_unavailable being uninitialized in case
the user doesn't give the value in modargs.
This commit is contained in:
Tanu Kaskinen 2014-10-06 13:30:35 +03:00
parent f460676ee0
commit 8fb5e7c32a

View file

@ -182,7 +182,7 @@ int pa__init(pa_module*m) {
return -1; return -1;
} }
m->userdata = u = pa_xnew(struct userdata, 1); m->userdata = u = pa_xnew0(struct userdata, 1);
/* A little bit later than module-rescue-streams... */ /* A little bit later than module-rescue-streams... */
u->sink_put_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_PUT], PA_HOOK_LATE+30, (pa_hook_cb_t) sink_put_hook_callback, u); u->sink_put_slot = pa_hook_connect(&m->core->hooks[PA_CORE_HOOK_SINK_PUT], PA_HOOK_LATE+30, (pa_hook_cb_t) sink_put_hook_callback, u);