From 30395e30c0ef71674bc6ea56c6532f02518f0637 Mon Sep 17 00:00:00 2001 From: Valtteri Koskivuori Date: Mon, 8 Jan 2024 22:33:24 +0200 Subject: [PATCH] lib: Fix memory leak in parseScene() I didn't update this call site when I refactored cr_scene_set_background() to not free the node that was passed in. --- src/common/json_loader.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/common/json_loader.c b/src/common/json_loader.c index 2668606a..e52c8474 100644 --- a/src/common/json_loader.c +++ b/src/common/json_loader.c @@ -502,6 +502,7 @@ static void parseScene(struct cr_renderer *r, const cJSON *data) { struct cr_shader_node *background = cr_shader_node_build(cJSON_GetObjectItem(data, "ambientColor")); cr_scene_set_background(scene, background); + cr_shader_node_free(background); parse_primitives(r, cJSON_GetObjectItem(data, "primitives")); parse_meshes(r, cJSON_GetObjectItem(data, "meshes"));