X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Ffluke-45%2Fprotocol.c;h=16489007b830aeb02f8f5ce993054a11b8463072;hb=HEAD;hp=5d9c3793e8b119da0c6198c648181845d43908ad;hpb=ab2b21fb681a6dc3cfb12568886c6af9b8ffe6ff;p=libsigrok.git diff --git a/src/hardware/fluke-45/protocol.c b/src/hardware/fluke-45/protocol.c index 5d9c3793..16489007 100644 --- a/src/hardware/fluke-45/protocol.c +++ b/src/hardware/fluke-45/protocol.c @@ -332,6 +332,7 @@ SR_PRIV int fl45_scpi_get_response(const struct sr_dev_inst *sdi, char *cmd) * 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) @@ -339,9 +340,10 @@ SR_PRIV int fl45_scpi_get_response(const struct sr_dev_inst *sdi, char *cmd) } /* 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; }