if (msg->data[msg->length - sizeof(struct dlog_control_msg)] != 0)
return -EINVAL;
+ __attribute__((cleanup(reader_pipe_cleanup))) struct reader_pipe *reader = NULL;
+
struct dlogutil_line_params params;
int retval = get_dlogutil_line_params(msg->data, ¶ms);
if (retval < 0)
- return retval;
+ goto cleanup;
if (params.file_path) {
/* Do not trust writer-based readers (only config-based).
* middleman and become able to write to a file directly
* though. The daemon should become able to receive an
* opened file descriptor from a writer. */
- return -EPERM;
+ retval = -EPERM;
+ goto cleanup;
}
- __attribute__((cleanup(reader_pipe_cleanup))) struct reader_pipe *reader = NULL;
retval = reader_pipe_init_with_writer(&reader, wr, server, params.filter, params.file, params.monitor, params.is_dumping);
if (retval != 0)
goto cleanup;