Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
diffcore-rename: plug memory leak.
author
Junio C Hamano
<junkio@cox.net>
Thu, 23 Feb 2006 03:45:48 +0000
(19:45 -0800)
committer
Junio C Hamano
<junkio@cox.net>
Thu, 23 Feb 2006 03:45:48 +0000
(19:45 -0800)
Spotted by Nicolas Pitre.
Signed-off-by: Junio C Hamano <junkio@cox.net>
diffcore-rename.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
6dc78e6
)
diff --git
a/diffcore-rename.c
b/diffcore-rename.c
index 39d9126cb9d397df06d41495a3402123fa4ba46b..ffd126af0d2cd3539e0f186e83c7671132758e6b 100644
(file)
--- a/
diffcore-rename.c
+++ b/
diffcore-rename.c
@@
-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)) {