Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Junio C Hamano committed Apr 3, 2016
2 parents 3583bf5 + 87f1625 commit aa3a2c2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion xdiff/xprepare.c
Expand Up @@ -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;
Expand Down

0 comments on commit aa3a2c2

Please sign in to comment.