return NULL;
}
+ if (client) {
+ inst->client = client_ref(client);
+ if (client_event_callback_add(inst->client, CLIENT_EVENT_DEACTIVATE, client_deactivated_cb, inst) < 0) {
+ ErrPrint("Failed to add client event callback: %s\n", inst->id);
+ }
+ }
+
if (fork_package(inst, pkgname) < 0) {
+ (void)client_unref(inst->client);
DbgFree(inst->title);
DbgFree(inst->category);
DbgFree(inst->cluster);
return NULL;
}
- if (client) {
- inst->client = client_ref(client);
- if (client_event_callback_add(inst->client, CLIENT_EVENT_DEACTIVATE, client_deactivated_cb, inst) < 0) {
- ErrPrint("Failed to add client event callback: %s\n", inst->id);
- }
- }
-
inst->state = INST_INIT;
inst->requested_state = INST_INIT;
instance_ref(inst);