Browse Source

cli: prevent segfault if input file failed to open

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Jo-Philipp Wich 8 years ago
parent
commit
10324627c7
1 changed files with 1 additions and 1 deletions
  1. 1 1
      main.c

+ 1 - 1
main.c

@@ -444,7 +444,7 @@ out:
 	if (jsobj)
 		json_object_put(jsobj);
 
-	if (input != stdin)
+	if (input && input != stdin)
 		fclose(input);
 
 	return rv;