esource = (struct eclient_source *)source;
esource->pollfd.fd = -1;
esource->client = disorder_eclient_new(>kclient_callbacks, source);
+ if(!esource->client) {
+ g_source_destroy(source);
+ return 0;
+ }
g_source_attach(source, 0);
return esource->client;
}
mainloop = g_main_loop_new(0, 0);
if(config_read()) fatal(0, "cannot read configuration");
/* create the clients */
- client = gtkclient();
- logclient = gtkclient();
+ if(!(client = gtkclient())
+ || !(logclient = gtkclient()))
+ return 1; /* already reported an error */
disorder_eclient_log(logclient, &gdisorder_log_callbacks, 0);
/* periodic operations (e.g. expiring the cache) */
g_timeout_add(600000/*milliseconds*/, periodic, 0);