*/
#include <config.h>
-#include <rpc/rpc.h>
+/* vxi.h must the first #include after config.h See commit d40b8557. */
+#include "vxi.h"
#include <string.h>
#include <libsigrok/libsigrok.h>
#include "libsigrok-internal.h"
#include "scpi.h"
-#include "vxi.h"
#define LOG_PREFIX "scpi_vxi"
#define VXI_DEFAULT_TIMEOUT_MS 2000
if (!read_resp || read_resp->error) {
sr_err("Device read failed for %s with error %ld",
vxi->address, read_resp ? read_resp->error : 0);
+ if (read_resp) {
+ g_free(read_resp->data.data_val);
+ read_resp->data.data_val = NULL;
+ }
return SR_ERR;
}
memcpy(buf, read_resp->data.data_val, read_resp->data.data_len);
+ g_free(read_resp->data.data_val);
+ read_resp->data.data_val = NULL;
vxi->read_complete = read_resp->reason & (RRR_TERM | RRR_END);
return read_resp->data.data_len; /* actual number of bytes received */
}