commit acd4ff87e51fe0de84244536dfae7f503c4635ae from: Omar Polo via: Thomas Adam date: Fri Sep 02 15:54:01 2022 UTC gotwebd: don't close tag in got_get_repo_tags too early it's still used a bit later, so defer the free'ing at the next loop iteration or at function end. commit - ddcf1d336cfcbb86f25f1d7bc1158316138b126d commit + acd4ff87e51fe0de84244536dfae7f503c4635ae blob - 00979097b8b3768929f4f506706fa113b708e190 blob + 55b30a337a5c628b4223bae7a3692a830ab1f1d2 --- gotwebd/got_operations.c +++ gotwebd/got_operations.c @@ -654,6 +654,8 @@ got_get_repo_tags(struct request *c, int limit) if (error) goto done; + if (tag) + got_object_tag_close(tag); error = got_object_open_as_tag(&tag, repo, id); if (error) { if (error->code != GOT_ERR_OBJ_TYPE) @@ -686,9 +688,6 @@ got_get_repo_tags(struct request *c, int limit) got_object_tag_get_object_id(tag)); if (error) goto err; - - got_object_tag_close(tag); - tag = NULL; } new_repo_tag->commit_id = strdup(id_str);