diff options
author | Jeff King <peff@peff.net> | 2011-03-29 16:56:53 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-03-29 14:30:54 -0700 |
commit | 304cc11c6566cf22e811aa791988c61b6d291973 (patch) | |
tree | 6fd82e26abd5019c134016a44b3f93566daca704 /revision.c | |
parent | c063f0a973832784f09a6901eac9501b6f796bde (diff) | |
download | git-304cc11c6566cf22e811aa791988c61b6d291973.tar.gz |
notes: refactor display notes extra refs field
There's no need to use an extra pointer, which just ends up
leaking memory. The fact that the list is empty tells us the
same thing.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r-- | revision.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/revision.c b/revision.c index 5826e5d599..24b89ebfdc 100644 --- a/revision.c +++ b/revision.c @@ -1372,11 +1372,9 @@ static int handle_revision_opt(struct rev_info *revs, int argc, const char **arg struct strbuf buf = STRBUF_INIT; revs->show_notes = 1; revs->show_notes_given = 1; - if (!revs->notes_opt.extra_notes_refs) - revs->notes_opt.extra_notes_refs = xcalloc(1, sizeof(struct string_list)); strbuf_addstr(&buf, arg+13); expand_notes_ref(&buf); - string_list_append(revs->notes_opt.extra_notes_refs, + string_list_append(&revs->notes_opt.extra_notes_refs, strbuf_detach(&buf, NULL)); } else if (!strcmp(arg, "--no-notes")) { revs->show_notes = 0; |