From: Renato Caldas Date: Thu, 5 Jan 2012 23:37:54 +0000 (+0000) Subject: link-mso19: fixed segmentation fault. X-Git-Tag: libsigrok-0.1.0~186 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d88b9393241e250590333326a4f8d19b53b4bdc6;p=libsigrok.git link-mso19: fixed segmentation fault. --- diff --git a/hardware/link-mso19/link-mso19.c b/hardware/link-mso19/link-mso19.c index fdcc0a48..c2fa7e88 100644 --- a/hardware/link-mso19/link-mso19.c +++ b/hardware/link-mso19/link-mso19.c @@ -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;