mirror of
https://github.com/git/git
synced 2024-08-25 10:45:59 +00:00
diffcore-rename: plug memory leak.
Spotted by Nicolas Pitre. Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
parent
6dc78e696b
commit
09a5d72d8e
|
@ -176,8 +176,10 @@ static int estimate_similarity(struct diff_filespec *src,
|
|||
/* A delta that has a lot of literal additions would have
|
||||
* big delta_size no matter what else it does.
|
||||
*/
|
||||
if (base_size * (MAX_SCORE-minimum_score) < delta_size * MAX_SCORE)
|
||||
if (base_size * (MAX_SCORE-minimum_score) < delta_size * MAX_SCORE) {
|
||||
free(delta);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Estimate the edit size by interpreting delta. */
|
||||
if (count_delta(delta, delta_size, &src_copied, &literal_added)) {
|
||||
|
|
Loading…
Reference in a new issue