packet.type = SR_DF_META;
packet.payload = &meta;
- meta.config = g_slist_append(meta.config, cfg);
+ meta.config = g_slist_append(NULL, cfg);
ret = sr_session_send(sdi, &packet);
+ g_slist_free(meta.config);
sr_config_free(cfg);
return ret;
g_variant_new_uint64(devc->buf[7] * 1000));
meta.config = g_slist_append(NULL, src);
sr_session_send(sdi, &packet);
- g_free(src);
+ g_slist_free(meta.config);
+ sr_config_free(src);
devc->buf_len = 0;
}
} else if (devc->state == ST_GET_LOG_RECORD_DATA) {
packet.payload = &meta;
meta.config = g_slist_append(NULL, src);
sr_session_send(sdi, &packet);
- g_free(src);
+ g_slist_free(meta.config);
+ sr_config_free(src);
}
if (!(devc->xfer = libusb_alloc_transfer(0)))
src = sr_config_new(SR_CONF_SAMPLE_INTERVAL, g_variant_new_uint64(interval));
meta.config = g_slist_append(NULL, src);
sr_session_send(sdi, &packet);
- g_free(src);
+ g_slist_free(meta.config);
+ sr_config_free(src);
if (devc->logged_samples == 0) {
/* This ensures the frontend knows the session is done. */
{
struct sr_datafeed_packet packet;
struct sr_datafeed_meta meta;
+ int ret;
memset(&meta, 0, sizeof(meta));
packet.type = SR_DF_META;
packet.payload = &meta;
- meta.config = g_slist_append(meta.config, cfg);
+ meta.config = g_slist_append(NULL, cfg);
+
+ ret = sr_session_send(sdi, &packet);
- return sr_session_send(sdi, &packet);
+ g_slist_free(meta.config);
+
+ return ret;
}
static int send_config_update_key(struct sr_dev_inst *sdi, uint32_t key,