Commit bd4ef3373b02541bdd55b8e2ea803f4672681734

Carlos Martín Nieto 2016-03-31T03:50:11

Merge pull request #3715 from pks-t/pks/xprepare-memleak xprepare memleaks

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/src/xdiff/xprepare.c b/src/xdiff/xprepare.c
index 63a22c6..3183d50 100644
--- a/src/xdiff/xprepare.c
+++ b/src/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;