From 52ef4e715d9f152cca02834c6d3f69ce212f41d6 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Tue, 18 Aug 2020 20:26:57 -0700 Subject: [PATCH] Fix dangling pointer in format_email. --- src/diff.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/diff.rs b/src/diff.rs index 412667ea2e..2718cf8d0f 100644 --- a/src/diff.rs +++ b/src/diff.rs @@ -266,7 +266,8 @@ impl<'repo> Diff<'repo> { message = &message[summary.len()..]; raw_opts.patch_no = patch_no; raw_opts.total_patches = total_patches; - raw_opts.id = commit.id().raw(); + let id = commit.id(); + raw_opts.id = id.raw(); raw_opts.summary = summary.as_ptr() as *const _; raw_opts.body = message.as_ptr() as *const _; raw_opts.author = commit.author().raw();