/* Mainloop */
if (!(m = pa_threaded_mainloop_new())) {
debug_error("mainloop create failed");
- goto error;
+ return -1;
}
/* Context */
if (!(c = pa_context_new(pa_threaded_mainloop_get_api(m), NULL))) {
debug_error("context create failed");
- goto error;
+ goto error_context_new;
}
pa_context_set_state_callback(c, _pa_context_state_callback, m);
return 0;
error:
- if (c)
- pa_context_unref(c);
-
+ pa_context_unref(c);
pa_threaded_mainloop_unlock(m);
-
- if (m)
- pa_threaded_mainloop_free(m);
+error_context_new:
+ pa_threaded_mainloop_free(m);
return -1;
}
ret = readdir_r(basedir, prev_entry, &entry);
if (ret == 0) {
- debug_error("error on readdir_r(%s)", basedir);
+ debug_error("error on readdir_r(%p)", basedir);
break;
}
if (entry == NULL)