const char *command, char **scpi_response)
{
GString *response;
- response = g_string_sized_new(1024);
+ *scpi_response = NULL;
+
+ response = g_string_sized_new(1024);
if (sr_scpi_get_data(scpi, command, &response) != SR_OK) {
if (response)
g_string_free(response, TRUE);
gchar **ptr, **tokens;
GArray *response_array;
+ *scpi_response = NULL;
response = NULL;
tokens = NULL;
if (ret != SR_OK && response_array->len == 0) {
g_array_free(response_array, TRUE);
- *scpi_response = NULL;
return SR_ERR_DATA;
}
gchar **ptr, **tokens;
GArray *response_array;
+ *scpi_response = NULL;
response = NULL;
tokens = NULL;
if (response_array->len == 0) {
g_array_free(response_array, TRUE);
- *scpi_response = NULL;
return SR_ERR_DATA;
}
long datalen;
gint64 timeout;
+ *scpi_response = NULL;
+
g_mutex_lock(&scpi->scpi_mutex);
if (command)
timeout = g_get_monotonic_time() + scpi->read_timeout_us;
- *scpi_response = NULL;
-
/* Get (the first chunk of) the response. */
do {
ret = scpi_read_response(scpi, response, timeout);
struct sr_scpi_hw_info *hw_info;
gchar *idn_substr;
+ *scpi_response = NULL;
response = NULL;
tokens = NULL;