mirror of
https://github.com/openwrt/openwrt.git
synced 2025-01-29 15:44:04 +00:00
fritz-tools: fix segfault in caldata-extract
* Fix incorrect error message in case input file opening fails * Don't close files in case the pointers are invalid Signed-off-by: David Bauer <mail@david-bauer.net>
This commit is contained in:
parent
19817fa3f5
commit
7662700613
@ -1,7 +1,7 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=fritz-tools
|
||||
PKG_RELEASE:=1
|
||||
PKG_RELEASE:=2
|
||||
CMAKE_INSTALL:=1
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
|
@ -210,7 +210,7 @@ int main(int argc, char **argv)
|
||||
if (argc > 1 && optind <= argc) {
|
||||
in = fopen(argv[optind], "r");
|
||||
if (!in) {
|
||||
perror("Failed to create output file");
|
||||
perror("Failed to open input file");
|
||||
goto out_bad;
|
||||
}
|
||||
}
|
||||
@ -253,7 +253,9 @@ out_bad:
|
||||
ret = EXIT_FAILURE;
|
||||
|
||||
out:
|
||||
fclose(in);
|
||||
fclose(out);
|
||||
if (in)
|
||||
fclose(in);
|
||||
if (out)
|
||||
fclose(out);
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user