]> sigrok.org Git - libsigrok.git/commitdiff
link-mso19: fixed segmentation fault.
authorRenato Caldas <redacted>
Thu, 5 Jan 2012 23:37:54 +0000 (23:37 +0000)
committerUwe Hermann <redacted>
Fri, 6 Jan 2012 00:01:57 +0000 (01:01 +0100)
hardware/link-mso19/link-mso19.c

index fdcc0a48da48837a3dac14cde01a73164c014e29..c2fa7e885526ec13362fdf56305d0345512bf942 100644 (file)
@@ -449,7 +449,6 @@ static int hw_init(const char *deviceinfo)
                strncpy(product, iProduct, s);
                product[s] = 0;
                strcpy(manufacturer, iProduct + s);
-               sprintf(hwrev, "r%d", mso->hwrev);
 
                if (!(mso = g_try_malloc0(sizeof(struct mso)))) {
                        sr_err("mso19: %s: mso malloc failed", __func__);
@@ -460,6 +459,7 @@ static int hw_init(const char *deviceinfo)
                        sr_warn("Invalid iSerial: %s", iSerial);
                        goto err_free_mso;
                }
+               sprintf(hwrev, "r%d", mso->hwrev);
                /* hardware initial state */
                mso->ctlbase = 0;