refs.c
48.5 KB
-
refs: fix memory leak on rename · 5c6ae009
Current implementation of git_reference_rename() removes 'ref' from loose cache, but not frees it. In result 'ref' is not reachable any more and we have got memory leak. Let's re-add 'ref' with corrected name to loose cache instead of 'new_ref' and free 'new_ref' properly. 'rollback' path seems leak too. git_reference_rename() need to be rewritten for proper resource management. Signed-off-by: Kirill A. Shutemov <kirill@shutemov.name>
Kirill A. Shutemov committed