From a791021caad538c631c48839d0c7ed8bb071d9e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lukas=20Sandstr=C3=B6m?= Date: Sun, 28 Sep 2014 17:59:53 +0200 Subject: [PATCH] Prevent segfault due to calling pthread_join with invalid thread id. --- tools/nut-scanner/nut-scanner.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/nut-scanner/nut-scanner.c b/tools/nut-scanner/nut-scanner.c index db582be..b6446b5 100644 --- a/tools/nut-scanner/nut-scanner.c +++ b/tools/nut-scanner/nut-scanner.c @@ -443,7 +443,7 @@ display_help: if( allow_xml && nutscan_avail_xml_http ) { pthread_join(thread[TYPE_XML],NULL); } - if( allow_oldnut && nutscan_avail_nut ) { + if( allow_oldnut && nutscan_avail_nut && start_ip ) { pthread_join(thread[TYPE_NUT],NULL); } if( allow_avahi && nutscan_avail_avahi ) { -- 1.8.5.5