commit a31cea734b6d4cb3000248c0f6f7a4155aea252d from: Stefan Sperling date: Sat Sep 15 18:43:39 2018 UTC fix leaked trees in got_object_tree_path_changed() commit - 48d5fe422307cd31e7dc2af67d5eb5e7384710b0 commit + a31cea734b6d4cb3000248c0f6f7a4155aea252d blob - 0e9ce6bd1ab9d43655e5a376353407a19b806e94 blob + 48da912bbce374d5db01809238ca58fd3b72b305 --- lib/object.c +++ lib/object.c @@ -872,6 +872,8 @@ got_object_tree_path_changed(int *changed, te1 = NULL; if (err) goto done; + if (tree1 != tree01) + got_object_tree_close(tree1); tree1 = next_tree1; err = got_object_open_as_tree(&next_tree2, repo, @@ -879,14 +881,16 @@ got_object_tree_path_changed(int *changed, te2 = NULL; if (err) goto done; + if (tree2 != tree02) + got_object_tree_close(tree2); tree2 = next_tree2; } } done: free(s0); - if (tree1 != tree01) + if (tree1 && tree1 != tree01) got_object_tree_close(tree1); - if (tree2 != tree02) + if (tree2 && tree2 != tree02) got_object_tree_close(tree2); return err; }