aboutsummaryrefslogtreecommitdiff
path: root/utils/telldus-core/patches/120-fix_missing_var_conf.patch
blob: d148423d135fd12017aa85d77166f85e96553aeb (plain)
1
2
3
4
5
6
7
8
9
10
11
Added a missing initialisation that under special circumstanses causes seg fault.
--- a/service/SettingsConfuse.cpp
+++ b/service/SettingsConfuse.cpp
@@ -435,6 +435,7 @@ bool readVarConfig(cfg_t **cfg) {
 
 	FILE *fp = fopen(VAR_CONFIG_FILE, "re");  // e for setting O_CLOEXEC on the file handle
 	if (!fp) {
+		(*cfg) = 0;
 		Log::warning("Unable to open var config file, %s", VAR_CONFIG_FILE);
 		return false;
 	}