summaryrefslogtreecommitdiff
path: root/builtin/shortlog.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/shortlog.c')
-rw-r--r--builtin/shortlog.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/builtin/shortlog.c b/builtin/shortlog.c
index 62c4a4eaba..35825f075e 100644
--- a/builtin/shortlog.c
+++ b/builtin/shortlog.c
@@ -81,8 +81,10 @@ static void insert_one_record(struct shortlog *log,
format_subject(&subject, oneline, " ");
buffer = strbuf_detach(&subject, NULL);
- if (!item->util)
- item->util = xcalloc(1, sizeof(struct string_list));
+ if (!item->util) {
+ item->util = xmalloc(sizeof(struct string_list));
+ string_list_init_nodup(item->util);
+ }
string_list_append(item->util, buffer);
}
}
@@ -420,6 +422,8 @@ parse_done:
else
get_from_rev(&rev, &log);
+ release_revisions(&rev);
+
shortlog_output(&log);
if (log.file != stdout)
fclose(log.file);