Skip to content

Commit 183ecc3

Browse files
committed
Merge branch 'rj/xdiff-prepare-plug-leak-on-error-codepath' into maint
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
2 parents dc66371 + 87f1625 commit 183ecc3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

xdiff/xprepare.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,10 +301,11 @@ int xdl_prepare_env(mmfile_t *mf1, mmfile_t *mf2, xpparam_t const *xpp,
301301

302302
xdl_free_ctx(&xe->xdf2);
303303
xdl_free_ctx(&xe->xdf1);
304+
xdl_free_classifier(&cf);
304305
return -1;
305306
}
306307

307-
if (!(xpp->flags & XDF_HISTOGRAM_DIFF))
308+
if (XDF_DIFF_ALG(xpp->flags) != XDF_HISTOGRAM_DIFF)
308309
xdl_free_classifier(&cf);
309310

310311
return 0;

0 commit comments

Comments
 (0)