Browse code

core: main - set ending 0 in allocated cfg file path

Daniel-Constantin Mierla authored on 15/04/2021 08:28:24
Showing 1 changed files
... ...
@@ -1288,7 +1288,7 @@ int fix_cfg_file(void)
1288 1288
 		}
1289 1289
 		if ((res = malloc(cfg_len + 1)) == NULL) goto error;
1290 1290
 		memcpy(res, cfg_file, cfg_len);
1291
-		cfg_file[cfg_len] = 0;
1291
+		res[cfg_len] = 0;
1292 1292
 		cfg_file = res;
1293 1293
 		return 0;
1294 1294
 	}