commit - 267bb3b89907b99d17aece9890a57afe2982b782
commit + aa8b5dd032c8cba930e5be67a90069a95e0001b8
blob - eead62c4d2989b648729acc4857033da98231ab3
blob + 71cc16e4b52a05afc8991d3d0c566bd8c200b3d7
--- got/got.c
+++ got/got.c
if (err)
return err;
- tree_id1 = got_object_commit_get_tree_id(pcommit);
+ tree_id1 = got_object_id_dup(
+ got_object_commit_get_tree_id(pcommit));
+ if (tree_id1 == NULL) {
+ got_object_commit_close(pcommit);
+ return got_error_from_errno("got_object_id_dup");
+ }
got_object_commit_close(pcommit);
}
got_object_tree_close(tree1);
if (tree2)
got_object_tree_close(tree2);
+ free(tree_id1);
return err;
}
blob - bc64c6af7747946ee999102bd29e8c420df1a314
blob + c175ea3c10692ebe9286741d643cd9b65fb4140c
--- tog/tog.c
+++ tog/tog.c
if (err)
return err;
- tree_id1 = got_object_commit_get_tree_id(pcommit);
+ tree_id1 = got_object_id_dup(
+ got_object_commit_get_tree_id(pcommit));
+ if (tree_id1 == NULL) {
+ got_object_commit_close(pcommit);
+ return got_error_from_errno("got_object_id_dup");
+ }
got_object_commit_close(pcommit);
}
got_object_tree_close(tree1);
if (tree2)
got_object_tree_close(tree2);
+ free(tree_id1);
return err;
}