Skip to content

Commit

Permalink
Merge branch 'maint'
Browse files Browse the repository at this point in the history
* maint:
  xdiff-interface.c: always trim trailing space from xfuncname matches
  diff.c: call regfree to free memory allocated by regcomp when necessary
  • Loading branch information
gitster committed Sep 10, 2010
2 parents bff4206 + 1b6ecba commit 8ac8cf5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 4 additions & 1 deletion diff.c
Expand Up @@ -919,7 +919,10 @@ static void free_diff_words_data(struct emit_callback *ecbdata)
free (ecbdata->diff_words->minus.orig);
free (ecbdata->diff_words->plus.text.ptr);
free (ecbdata->diff_words->plus.orig);
free(ecbdata->diff_words->word_regex);
if (ecbdata->diff_words->word_regex) {
regfree(ecbdata->diff_words->word_regex);
free(ecbdata->diff_words->word_regex);
}
free(ecbdata->diff_words);
ecbdata->diff_words = NULL;
}
Expand Down
5 changes: 2 additions & 3 deletions xdiff-interface.c
Expand Up @@ -286,9 +286,8 @@ static long ff_regexp(const char *line, long len,
result = pmatch[i].rm_eo - pmatch[i].rm_so;
if (result > buffer_size)
result = buffer_size;
else
while (result > 0 && (isspace(line[result - 1])))
result--;
while (result > 0 && (isspace(line[result - 1])))
result--;
memcpy(buffer, line, result);
fail:
free(line_buffer);
Expand Down

0 comments on commit 8ac8cf5

Please sign in to comment.