From bcee01d7052c208e039a241c90138448b969d2ff Mon Sep 17 00:00:00 2001 From: Uwe Bonnes Date: Sat, 10 Dec 2011 17:17:25 +0100 Subject: [PATCH] Chevck first for NULL before writing anything to the alloceted structure --- flash/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) -- 2.30.2