{"thread":{"id":"41613","subject":"[PATCH 0/2] diff: fix a memory leak","startedAt":"2016-03-04T23:07:40Z","lastAt":"2016-03-04T23:07:40Z","messageCount":1,"participants":["Ramsay Jones"],"isPatch":true,"patchVersion":1,"patchTotal":2},"messages":[{"id":"280215","messageId":"56DA153C.1060802@ramsayjones.plus.com","threadId":"41613","inReplyTo":null,"subject":"[PATCH 0/2] diff: fix a memory leak","fromName":"Ramsay Jones","fromEmail":"ramsay@ramsayjones.plus.com","sentAt":"2016-03-04T23:07:40Z","receivedAt":"2016-03-04T23:07:40Z","isPatch":true,"sender":{"key":"ramsay@ramsayjones.plus.com","avatar":"https://avatars.githubusercontent.com/u/33702710?v=4"},"body":"\nA recent memory leak patch from Patrick, commit 4867f1184\n(\"xdiff/xmerge: fix memory leak in xdl_merge\", 23-02-2016),\nreminded me that I had a similar patch lying around.\n\nAfter checking that it wasn't the same one, I dusted it off, and\nsplit it into these two patches.\n\nOne of the reasons for not sending it earlier was that it is\nnot very likely to happen (without very large files), and I had\nto use the debugger to confirm the leak and the fix.\n\n[If you want to do so yourself, then I suggest that you use\ntwo files that actually have changes and do 'run --no-pager diff\n--no-index file-1 file-2'. set breakpoints on xdl_prepare_env,\nxdl_init_classifier, xdl_free_classifier, xdl_optimize_ctxs and\nxdl_cleanup_records. You have to force xdl_cleanup_records to\nreturn -1 to simulate an OOM. Since xdl_free_classifier does\nnot set the allocated fields to NULL, you have to make sure that\nyou do/don't hit that breakpoint before the return at line #304/305.]\n\nRamsay Jones (2):\n  xdiff/xprepare: use the XDF_DIFF_ALG() macro to access flag bits\n  xdiff/xprepare: fix a memory leak\n\n xdiff/xprepare.c | 3 ++-\n 1 file changed, 2 insertions(+), 1 deletion(-)\n\n-- \n2.7.0\n"}]}