diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-09-22 11:54:30 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-09-22 11:54:30 -0700 |
| commit | b178f27e6ddfa8d515dcd445b6bf17119f962c44 (patch) | |
| tree | add91f18da6f021225dea7166681453879df91ed /builtin/describe.c | |
| parent | Merge branch 'pw/rebase-i-cleanup-fix' into next (diff) | |
| parent | revision: retain argv NULL invariant in setup_revisions() (diff) | |
| download | git-b178f27e6ddfa8d515dcd445b6bf17119f962c44.tar.gz git-b178f27e6ddfa8d515dcd445b6bf17119f962c44.zip | |
Merge branch 'jk/setup-revisions-freefix' into next
There are double frees and leaks around setup_revisions() API used
in "git stash show", which has been fixed, and setup_revisions()
API gained a wrapper to make it more ergonomic when using it with
strvec-manged argc/argv pairs.
* jk/setup-revisions-freefix:
revision: retain argv NULL invariant in setup_revisions()
treewide: pass strvecs around for setup_revisions_from_strvec()
treewide: use setup_revisions_from_strvec() when we have a strvec
revision: add wrapper to setup_revisions() from a strvec
revision: manage memory ownership of argv in setup_revisions()
stash: tell setup_revisions() to free our allocated strings
Diffstat (limited to 'builtin/describe.c')
| -rw-r--r-- | builtin/describe.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/describe.c b/builtin/describe.c index 9f4e26d7ff..ffaf8d9f0a 100644 --- a/builtin/describe.c +++ b/builtin/describe.c @@ -580,7 +580,8 @@ static void describe_blob(const struct object_id *oid, struct strbuf *dst) NULL); repo_init_revisions(the_repository, &revs, NULL); - if (setup_revisions(args.nr, args.v, &revs, NULL) > 1) + setup_revisions_from_strvec(&args, &revs, NULL); + if (args.nr > 1) BUG("setup_revisions could not handle all args?"); if (prepare_revision_walk(&revs)) |
