On 06/16/2018 10:23 PM, John Keeping wrote:
On Wed, Jun 13, 2018 at 10:02:05AM +0800, Andy Green wrote:
Signed-off-by: Andy Green <[email protected]>
---
  ui-blame.c |    3 +++
  1 file changed, 3 insertions(+)

diff --git a/ui-blame.c b/ui-blame.c
index 17e2d60..a5c7d69 100644
--- a/ui-blame.c
+++ b/ui-blame.c
@@ -206,6 +206,9 @@ static void print_object(const unsigned char *sha1, const 
char *path,

There's an early return above here after allocating buf, I'm not sure if
we care about freeing buf on that path as well.

If we do, I guess we push free(buf) to the end and add a free_buf label
for the error path to jump to.

Yes, I missed it thanks.  I adapted it with the label.

        } else {
                html_txt(buf);
        }
+
+       free(buf);
+
        html("</code></pre>");
html("</div></td>\n");

_______________________________________________
CGit mailing list
[email protected]
https://lists.zx2c4.com/mailman/listinfo/cgit

Reply via email to