From: Ramkumar Ramachandra Date: Tue, 22 May 2012 05:14:59 GMT Subject: Re: [PATCH 4/7] revert: free opts.revs to do a bit of cleanup Message-ID: In-Reply-To: <20120521145610.1911.57879.chriscool@tuxfamily.org> Hi Christian, Christian Couder wrote: > diff --git a/builtin/revert.c b/builtin/revert.c > index 82d1bf8..5f82a84 100644 > --- a/builtin/revert.c > +++ b/builtin/revert.c > @@ -217,6 +217,7 @@ int cmd_revert(int argc, const char **argv, const char *prefix) >        git_config(git_default_config, NULL); >        parse_args(argc, argv, &opts); >        res = sequencer_pick_revisions(&opts); > +       free(opts.revs); >        if (res < 0) >                die(_("revert failed")); >        return res; > @@ -232,6 +233,7 @@ int cmd_cherry_pick(int argc, const char **argv, const char *prefix) >        git_config(git_default_config, NULL); >        parse_args(argc, argv, &opts); >        res = sequencer_pick_revisions(&opts); > +       free(opts.revs); >        if (res < 0) >                die(_("cherry-pick failed")); >        return res; Technically, memory is allocated to both opts->revs and opts->xopts in parse_args(). Why not free both? Ram