summaryrefslogtreecommitdiff
path: root/xdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2016-04-03 10:29:33 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-04-03 10:29:33 -0700
commitaa3a2c2af600e6aea73df63c11a0eb88a00b6444 (patch)
tree39b29ea5b7d1662d747c6839f5d63f6a978c60ed /xdiff
parentMerge branch 'jc/index-pack' (diff)
parentxdiff/xprepare: fix a memory leak (diff)
downloadtgif-aa3a2c2af600e6aea73df63c11a0eb88a00b6444.tar.xz
Merge branch 'rj/xdiff-prepare-plug-leak-on-error-codepath'
A small memory leak in an error codepath has been plugged in xdiff code. * rj/xdiff-prepare-plug-leak-on-error-codepath: xdiff/xprepare: fix a memory leak xdiff/xprepare: use the XDF_DIFF_ALG() macro to access flag bits
Diffstat (limited to 'xdiff')
-rw-r--r--xdiff/xprepare.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xdiff/xprepare.c b/xdiff/xprepare.c
index 63a22c630e..13b55aba74 100644
--- a/xdiff/xprepare.c
+++ b/xdiff/xprepare.c
@@ -301,10 +301,11 @@ int xdl_prepare_env(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
xdl_free_ctx(&xe->xdf2);
xdl_free_ctx(&xe->xdf1);
+ xdl_free_classifier(&cf);
return -1;
}
- if (!(xpp->flags & XDF_HISTOGRAM_DIFF))
+ if (XDF_DIFF_ALG(xpp->flags) != XDF_HISTOGRAM_DIFF)
xdl_free_classifier(&cf);
return 0;