Merge branch 'sb/line-log-plug-pairdiff-leak' into maint
authorJunio C Hamano <gitster@pobox.com>
Wed, 13 May 2015 21:05:56 +0000 (14:05 -0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 13 May 2015 21:05:56 +0000 (14:05 -0700)
* sb/line-log-plug-pairdiff-leak:
  line-log.c: fix a memleak

1  2 
line-log.c

diff --combined line-log.c
@@@ -237,7 -237,7 +237,7 @@@ static void diff_ranges_release(struct 
        range_set_release(&diff->target);
  }
  
 -void line_log_data_init(struct line_log_data *r)
 +static void line_log_data_init(struct line_log_data *r)
  {
        memset(r, 0, sizeof(struct line_log_data));
        range_set_init(&r->ranges, 0);
@@@ -575,7 -575,7 +575,7 @@@ parse_lines(struct commit *commit, cons
  
                name_part = skip_range_arg(item->string);
                if (!name_part || *name_part != ':' || !name_part[1])
 -                      die("-L argument '%s' not of the form start,end:file",
 +                      die("-L argument not 'start,end:file' or ':funcname:file': %s",
                            item->string);
                range_part = xstrndup(item->string, name_part - item->string);
                name_part++;
@@@ -1099,6 -1099,7 +1099,7 @@@ static int process_all_files(struct lin
                        rg->pair = diff_filepair_dup(queue->queue[i]);
                        memcpy(&rg->diff, pairdiff, sizeof(struct diff_ranges));
                }
+               free(pairdiff);
        }
  
        return changed;