From: Jo-Philipp Wich Date: Tue, 27 Oct 2015 12:42:00 +0000 (+0100) Subject: cli: prevent segfault if input file failed to open X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=10324627c792702a94d4c3a1c53a7d8b419b114b;p=oweals%2Fjsonpath.git cli: prevent segfault if input file failed to open Signed-off-by: Jo-Philipp Wich --- diff --git a/main.c b/main.c index 0f1a39b..e4902d9 100644 --- a/main.c +++ b/main.c @@ -444,7 +444,7 @@ out: if (jsobj) json_object_put(jsobj); - if (input != stdin) + if (input && input != stdin) fclose(input); return rv;