commit 3e99fbc53402ddf1e875a7399c51253825c8c310 from: Omar Polo date: Wed Mar 23 20:59:29 2022 UTC plug a memory leak in list_refs(), ok stsp@ commit - bc5e881ab9b3f23c4c4d00845d2e553d4fcd7e56 commit + 3e99fbc53402ddf1e875a7399c51253825c8c310 blob - fb5211d500574e714e2964dd6a9ab1ac8433e57d blob + f3608d970c5ae77fee89a4e9ca8fdb89b015c5f8 --- got/got.c +++ got/got.c @@ -5656,14 +5656,16 @@ list_refs(struct got_repository *repo, const char *ref TAILQ_FOREACH(re, &refs, entry) { char *refstr; refstr = got_ref_to_str(re->ref); - if (refstr == NULL) - return got_error_from_errno("got_ref_to_str"); + if (refstr == NULL) { + err = got_error_from_errno("got_ref_to_str"); + break; + } printf("%s: %s\n", got_ref_get_name(re->ref), refstr); free(refstr); } got_ref_list_free(&refs); - return NULL; + return err; } static const struct got_error *