reply = mrp_allocz(sizeof(asm_to_lib_t));
+ if (!reply)
+ return NULL;
+
reply->instance_id = pid;
reply->check_privilege = TRUE;
uint32_t handle = client->current_handle++;
resource_set_data_t *d = mrp_allocz(sizeof(resource_set_data_t));
+ if (!d)
+ goto error;
+
d->handle = handle;
d->ctx = ctx;
d->pid = pid;
if (!d->rset) {
mrp_log_error("Failed to create resource set!");
+ mrp_free(d);
goto error;
}
error:
+ if (!ctx)
+ return FALSE;
+
if (ctx->pid) {
kill(ctx->pid, SIGTERM);
ctx->pid = 0;
res.sound_state = msg->data.sound_state;
res.system_resource = msg->data.system_resource;
#ifdef USE_SECURITY
- {
- cookie_len = COOKIE_SIZE;
- cookie = msg->data.cookie;
- }
+ cookie_len = COOKIE_SIZE;
+ cookie = msg->data.cookie;
#endif
res.n_cookie_bytes = cookie_len;
msg->instance_id, msg->handle);
}
else {
-
wf = mrp_allocz(sizeof(struct watched_file));
+ if (!wf)
+ goto error;
+
wf->watched_file = mrp_strdup(rd_filename);
wf->ctx = ctx;
wf->instance_id = msg->instance_id;
mrp_htbl_config_t watches_conf;
ctx_t ctx;
+ ctx.watched_files = NULL;
/* set up the signal handling */