diff --git a/src/Main/options.cxx b/src/Main/options.cxx index 96a6fb538..a9aa034b1 100644 --- a/src/Main/options.cxx +++ b/src/Main/options.cxx @@ -1870,11 +1870,11 @@ public: cJSON *createJSONArrayFromPathList(const PathList& pl) const { cJSON *resultNode = cJSON_CreateArray(); + cJSON *prevNode = nullptr; bool isFirst = true; for (const SGPath& path : pl) { cJSON *pathNode = cJSON_CreateString(path.utf8Str().c_str()); - cJSON *prevNode = nullptr; if (isFirst) { isFirst = false;