X-Git-Url: https://sigrok.org/gitweb/?p=libsigrok.git;a=blobdiff_plain;f=src%2Fhardware%2Ffluke-45%2Fprotocol.c;h=16489007b830aeb02f8f5ce993054a11b8463072;hp=5d9c3793e8b119da0c6198c648181845d43908ad;hb=c9cfcd25917c4ee5767fa097d4fa8fb8a4888a6d;hpb=9b915e3a41311bff4d7089f564f3b2716f2004a7 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; }