sr_scpi_get_string(scpi, "ECHO-TEST", &response);
if (response && strcmp(response, "ECHO-TEST") == 0) {
sr_err("Serial port ECHO is ON. Please turn it OFF!");
+ g_free(response);
return NULL;
}
+ g_free(response);
#endif
/* Get device IDN. */
if (sr_scpi_get_hw_id(scpi, &hw_info) != SR_OK) {
+ sr_scpi_hw_info_free(hw_info);
sr_info("Couldn't get IDN response, retrying.");
sr_scpi_close(scpi);
sr_scpi_open(scpi);
if (sr_scpi_get_hw_id(scpi, &hw_info) != SR_OK) {
+ sr_scpi_hw_info_free(hw_info);
sr_info("Couldn't get IDN response.");
return NULL;
}
* If the response is a prompt then ignore and read the next
* response in the buffer.
*/
+ g_free(devc->response);
devc->response = NULL;
/* Now attempt to read again. */
if (sr_scpi_get_string(sdi->conn, NULL, &devc->response) != SR_OK)
}
/* NULL RS232 error prompts. */
- if (strcmp(devc->response, "!>") == 0
- || (strcmp(devc->response, "?>") == 0)) {
+ if (strcmp(devc->response, "!>") == 0 ||
+ (strcmp(devc->response, "?>") == 0)) {
/* Unable to execute CMD. */
+ g_free(devc->response);
devc->response = NULL;
}