From 304cc11c6566cf22e811aa791988c61b6d291973 Mon Sep 17 00:00:00 2001 From: Jeff King Date: Tue, 29 Mar 2011 16:56:53 -0400 Subject: 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 Signed-off-by: Junio C Hamano --- revision.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'revision.c') 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; -- cgit v1.2.1