commit 984065c8157b64c6706177b33cfedf5863f47d8e from: Stefan Sperling date: Thu Mar 19 17:27:20 2020 UTC avoid needless id_str allocation in cmd_fetch() commit - 4aa547dbcb2bafca9102632f6594b7854a57c643 commit + 984065c8157b64c6706177b33cfedf5863f47d8e blob - 9981ae675edf4e6cc520b4ec823cc315ab048828 blob + e0db90a7ad96ea19aefe46b6bd3ae0d3582c59bf --- got/got.c +++ got/got.c @@ -1382,13 +1382,14 @@ cmd_fetch(int argc, char *argv[]) goto done; } - error = got_object_id_str(&id_str, pack_hash); - if (error) - goto done; - if (verbosity >= 0) + if (verbosity >= 0) { + error = got_object_id_str(&id_str, pack_hash); + if (error) + goto done; printf("Fetched %s.pack\n", id_str); - free(id_str); - id_str = NULL; + free(id_str); + id_str = NULL; + } /* Update references provided with the pack file. */ TAILQ_FOREACH(pe, &refs, entry) {