commit 7add508939566c87bdcbcf95b0e14181f23ba65c from: Omar Polo via: Thomas Adam date: Sat Apr 16 08:06:50 2022 UTC plug a memory leak in list_refs(), ok stsp@ commit - cddff777c2bb2cbb221871f5fe45bbbcecb4c84c commit + 7add508939566c87bdcbcf95b0e14181f23ba65c blob - 3caf8920b59c60eace2a94659a300fb2d10e56fd blob + 9ad83f6fda96bd86090467d9e6fae196fc2aacf4 --- 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 *