Skip to content

Commit aed2e05

Browse files
committed
generator: fix some json memory leaks
1 parent bec77d9 commit aed2e05

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

src/shady/generator/generator.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,7 @@ int main(int argc, char** argv) {
161161
free(json_files[i].contents);
162162
json_object_put(json_files[i].root);
163163
}
164+
json_object_put(data.shd);
164165
json_tokener_free(tokener);
165166
free(spv_core_json_path);
166167
}

src/shady/generator/json_apply.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ void json_apply_object(json_object* target, json_object* src) {
2424
if (existing)
2525
warn_print("json-apply: overwriting key '%s'\n", name);
2626
json_object_object_add(target, name, value);
27+
json_object_get(value);
2728
}
2829
}
2930
}

0 commit comments

Comments
 (0)