]> sigrok.org Git - libsigrok.git/blobdiff - src/hardware/hp-3457a/api.c
scpi-pps: don't break SCPI devices when scanning for HP-IB devices
[libsigrok.git] / src / hardware / hp-3457a / api.c
index 64fdab54deef5cbc875d57f3b3c07fbb84a498c5..f828cfd817f3743c7c764561c8ac8c5737285cff 100644 (file)
@@ -138,13 +138,15 @@ 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") != 0) {
+               g_free(response);
                return NULL;
+       }
 
        g_free(response);
 
-       devc = g_malloc0(sizeof(struct dev_context));
-       sdi = g_malloc0(sizeof(struct sr_dev_inst));
+       devc = g_malloc0(sizeof(*devc));
+       sdi = g_malloc0(sizeof(*sdi));
        sdi->vendor = g_strdup("Hewlett-Packard");
        sdi->model = g_strdup("3457A");
        sdi->version = get_revision(scpi);