From: Uwe Bonnes Date: Sat, 10 Dec 2011 16:17:25 +0000 (+0100) Subject: Chevck first for NULL before writing anything to the alloceted structure X-Git-Url: https://git.gag.com/?p=fw%2Fstlink;a=commitdiff_plain;h=bcee01d7052c208e039a241c90138448b969d2ff Chevck first for NULL before writing anything to the alloceted structure --- diff --git a/flash/main.c b/flash/main.c index 39910b6..9033b17 100644 --- a/flash/main.c +++ b/flash/main.c @@ -91,14 +91,14 @@ int main(int ac, char** av) if (o.devname != NULL) /* stlinkv1 */ { sl = stlink_v1_open(50); - sl->verbose = 50; if (sl == NULL) goto on_error; + sl->verbose = 50; } else /* stlinkv2 */ { sl = stlink_open_usb(50); - sl->verbose = 50; if (sl == NULL) goto on_error; + sl->verbose = 50; } if (stlink_current_mode(sl) == STLINK_DEV_DFU_MODE)