]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/hp-3457a/api.c
hp-3457a: free memory that was allocated by SCPI get routines
[libsigrok.git] / src / hardware / hp-3457a / api.c
index 64fdab54deef5cbc875d57f3b3c07fbb84a498c5..6e42bb9ac91f23b1ad8c0c4cce47284763e96997 100644 (file)
@@ -138,8 +138,10 @@ static struct sr_dev_inst *probe_device(struct sr_scpi_dev_inst *scpi)
        if ((ret != SR_OK) || !response)
                return NULL;
 
-       if (strcmp(response, "HP3457A"))
+       if (strcmp(response, "HP3457A")) {
+               g_free(response);
                return NULL;
+       }
 
        g_free(response);