sr_dbg("Opened %s.", capturefile);
} else {
/* We got all the chunks, finish up. */
- g_free(vdev->capturefile);
vdev->finished = TRUE;
continue;
}
vdev->capfile = NULL;
if (vdev->cur_chunk == 0) {
/* It was the only file. */
- g_free(vdev->capturefile);
vdev->finished = TRUE;
} else {
/* There might be more chunks, so don't fall through
static int dev_close(struct sr_dev_inst *sdi)
{
+ const struct session_vdev *const vdev = sdi->priv;
+ g_free(vdev->sessionfile);
+ g_free(vdev->capturefile);
+
g_free(sdi->priv);
sdi->priv = NULL;
sr_info("Setting samplerate to %" PRIu64 ".", vdev->samplerate);
break;
case SR_CONF_SESSIONFILE:
+ g_free(vdev->sessionfile);
vdev->sessionfile = g_strdup(g_variant_get_string(data, NULL));
sr_info("Setting sessionfile to '%s'.", vdev->sessionfile);
break;
case SR_CONF_CAPTUREFILE:
+ g_free(vdev->capturefile);
vdev->capturefile = g_strdup(g_variant_get_string(data, NULL));
sr_info("Setting capturefile to '%s'.", vdev->capturefile);
break;
vdev = sdi->priv;
+ vdev->bytes_read = 0;
+ vdev->cur_chunk = 0;
+ vdev->finished = FALSE;
+
sr_info("Opening archive %s file %s", vdev->sessionfile,
vdev->capturefile);