X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Frigol-dg%2Fapi.c;h=a173243264576e2a0ff6e8859d03e240f464f080;hb=c3ada48afce7626a980c89e66d592a4242362c57;hp=ea8189b944a4eb3085486b1fa5b7aa823a687433;hpb=b1eb94bbef0312005f879b7525b11b8c7049aca1;p=libsigrok.git diff --git a/src/hardware/rigol-dg/api.c b/src/hardware/rigol-dg/api.c index ea8189b9..a1732432 100644 --- a/src/hardware/rigol-dg/api.c +++ b/src/hardware/rigol-dg/api.c @@ -380,12 +380,9 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi) for (i = 0; i < device->num_channels; i++) { ch = sr_channel_new(sdi, ch_idx++, SR_CHANNEL_ANALOG, TRUE, device->channels[i].name); - cg = g_malloc0(sizeof(*cg)); snprintf(tmp, sizeof(tmp), "%u", i + 1); - cg->name = g_strdup(tmp); + cg = sr_channel_group_new(sdi, tmp, NULL); cg->channels = g_slist_append(cg->channels, ch); - - sdi->channel_groups = g_slist_append(sdi->channel_groups, cg); } /* Create channels for the frequency counter output. */ @@ -780,6 +777,7 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) devc->counter_enabled = TRUE; else devc->counter_enabled = FALSE; + g_free(response); if (!devc->counter_enabled) { /* @@ -834,8 +832,6 @@ static int dev_acquisition_start(const struct sr_dev_inst *sdi) } } - g_free(response); - return ret; }