X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=src%2Fhardware%2Fserial-dmm%2Fapi.c;h=87e63b10f4f07b6413c056ebdd0e60d4632992ce;hb=0af636bed97c174bea46e61e961eaa1b0b162e0f;hp=70f05f2d52ccc8f7339a5b9a3eef9816ec452b71;hpb=6508992d04bf972ae98b8c7e97201c5164501687;p=libsigrok.git diff --git a/src/hardware/serial-dmm/api.c b/src/hardware/serial-dmm/api.c index 70f05f2d..87e63b10 100644 --- a/src/hardware/serial-dmm/api.c +++ b/src/hardware/serial-dmm/api.c @@ -456,9 +456,10 @@ static GSList *sdmm_scan(const char *conn, const char *serialcomm, int dmm) sr_info("Found device on port %s.", conn); - if (!(sdi = sr_dev_inst_new(SR_ST_INACTIVE, dmms[dmm].vendor, - dmms[dmm].device, NULL))) - goto scan_cleanup; + sdi = sr_dev_inst_new(); + sdi->status = SR_ST_INACTIVE; + sdi->vendor = g_strdup(dmms[dmm].vendor); + sdi->model = g_strdup(dmms[dmm].device); if (!(devc = g_try_malloc0(sizeof(struct dev_context)))) { sr_err("Device context malloc failed.");