Commit 95d96e91 authored by Michael Tross's avatar Michael Tross

fix invalid free pointer with wind and rain modules

parent e934776c
......@@ -392,13 +392,13 @@ static void parseModule(json_object* val, enum json_type type)
if (nmodule->type && (strcmp(nmodule->type, "NAModule2") == 0)) {
nmodule->values_num = 4;
vmodule[0].data_type = "WindAngle";
vmodule[1].data_type = "WindStrength";
vmodule[2].data_type = "GustAngle";
vmodule[3].data_type = "GustStrength";
vmodule[0].data_type = strdup("WindAngle");
vmodule[1].data_type = strdup("WindStrength");
vmodule[2].data_type = strdup("GustAngle");
vmodule[3].data_type = strdup("GustStrength");
} else if (nmodule->type && (strcmp(nmodule->type, "NAModule3") == 0)) {
nmodule->values_num = 1;
vmodule[0].data_type = "Rain";
vmodule[0].data_type = strdup("Rain");
} else {
nmodule->values_num = dtypes->length > MAX_VALUES ? MAX_VALUES : dtypes->length;
for (nd = 0; nd < nmodule->values_num; nd++) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment