• R
    xdiff/xprepare: fix a memory leak · 87f16258
    Ramsay Jones 提交于
    The xdl_prepare_env() function may initialise an xdlclassifier_t
    data structure via xdl_init_classifier(), which allocates memory
    to several fields, for example 'rchash', 'rcrecs' and 'ncha'.
    If this function later exits due to the failure of xdl_optimize_ctxs(),
    then this xdlclassifier_t structure, and the memory allocated to it,
    is not cleaned up.
    
    In order to fix the memory leak, insert a call to xdl_free_classifier()
    before returning.
    Signed-off-by: NRamsay Jones <ramsay@ramsayjones.plus.com>
    Signed-off-by: NJunio C Hamano <gitster@pobox.com>
    87f16258
xprepare.c 12.0 KB