瀏覽代碼

cli: prevent segfault if input file failed to open

Signed-off-by: Jo-Philipp Wich <jow@openwrt.org>
Jo-Philipp Wich 8 年之前
父節點
當前提交
10324627c7
共有 1 個文件被更改,包括 1 次插入1 次删除
  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;