+1
index de1c1cbec1..ebd3f642da 100644
--- a/builtin/log.c
+++ b/builtin/log.c
encoding, need_8bit_cte);
fprintf(rev->diffopt.file, "%s\n", sb.buf);
+ free(pp.after_subject);
strbuf_release(&sb);
shortlog_init(&log);
+6
-5
index 78e678e0e7..c3e77064e4 100644
--- a/log-tree.c
+++ b/log-tree.c
}
void log_write_email_headers(struct rev_info *opt, struct commit *commit,
- const char **extra_headers_p,
+ char **extra_headers_p,
int *need_8bit_cte_p,
int maybe_multipart)
{
- const char *extra_headers = opt->extra_headers;
+ char *extra_headers = xstrdup_or_null(opt->extra_headers);
const char *name = oid_to_hex(opt->zero_commit ?
null_oid() : &commit->object.oid);
graph_show_oneline(opt->graph);
}
if (opt->mime_boundary && maybe_multipart) {
- static struct strbuf subject_buffer = STRBUF_INIT;
+ struct strbuf subject_buffer = STRBUF_INIT;
static struct strbuf buffer = STRBUF_INIT;
struct strbuf filename = STRBUF_INIT;
*need_8bit_cte_p = -1; /* NEVER */
- strbuf_reset(&subject_buffer);
strbuf_reset(&buffer);
strbuf_addf(&subject_buffer,
extra_headers ? extra_headers : "",
mime_boundary_leader, opt->mime_boundary,
mime_boundary_leader, opt->mime_boundary);
- extra_headers = subject_buffer.buf;
+ free(extra_headers);
+ extra_headers = strbuf_detach(&subject_buffer, NULL);
if (opt->numbered_files)
strbuf_addf(&filename, "%d", opt->nr);
strbuf_release(&msgbuf);
free(ctx.notes_message);
+ free(ctx.after_subject);
if (cmit_fmt_is_mail(ctx.fmt) && opt->idiff_oid1) {
struct diff_queue_struct dq;
+1
-1
index 41c776fea5..94978e2c83 100644
--- a/log-tree.h
+++ b/log-tree.h
int use_color, const struct decoration_options *opts);
void show_decorations(struct rev_info *opt, struct commit *commit);
void log_write_email_headers(struct rev_info *opt, struct commit *commit,
- const char **extra_headers_p,
+ char **extra_headers_p,
int *need_8bit_cte_p,
int maybe_multipart);
void load_ref_decorations(struct decoration_filter *filter, int flags);
+1
-1
index 021bc1d658..9cc9e5d42b 100644
--- a/pretty.h
+++ b/pretty.h
*/
enum cmit_fmt fmt;
int abbrev;
- const char *after_subject;
+ char *after_subject;
int preserve_subject;
struct date_mode date_mode;
unsigned date_mode_explicit:1;