mirror of
https://github.com/git/git.git
synced 2024-11-24 18:33:43 +08:00
Merge branch 'maint'
* maint: xdiff-interface.c: always trim trailing space from xfuncname matches diff.c: call regfree to free memory allocated by regcomp when necessary
This commit is contained in:
commit
8ac8cf5bc1
3
diff.c
3
diff.c
@ -919,7 +919,10 @@ static void free_diff_words_data(struct emit_callback *ecbdata)
|
|||||||
free (ecbdata->diff_words->minus.orig);
|
free (ecbdata->diff_words->minus.orig);
|
||||||
free (ecbdata->diff_words->plus.text.ptr);
|
free (ecbdata->diff_words->plus.text.ptr);
|
||||||
free (ecbdata->diff_words->plus.orig);
|
free (ecbdata->diff_words->plus.orig);
|
||||||
|
if (ecbdata->diff_words->word_regex) {
|
||||||
|
regfree(ecbdata->diff_words->word_regex);
|
||||||
free(ecbdata->diff_words->word_regex);
|
free(ecbdata->diff_words->word_regex);
|
||||||
|
}
|
||||||
free(ecbdata->diff_words);
|
free(ecbdata->diff_words);
|
||||||
ecbdata->diff_words = NULL;
|
ecbdata->diff_words = NULL;
|
||||||
}
|
}
|
||||||
|
@ -286,7 +286,6 @@ static long ff_regexp(const char *line, long len,
|
|||||||
result = pmatch[i].rm_eo - pmatch[i].rm_so;
|
result = pmatch[i].rm_eo - pmatch[i].rm_so;
|
||||||
if (result > buffer_size)
|
if (result > buffer_size)
|
||||||
result = buffer_size;
|
result = buffer_size;
|
||||||
else
|
|
||||||
while (result > 0 && (isspace(line[result - 1])))
|
while (result > 0 && (isspace(line[result - 1])))
|
||||||
result--;
|
result--;
|
||||||
memcpy(buffer, line, result);
|
memcpy(buffer, line, result);
|
||||||
|
Loading…
Reference in New Issue
Block a user