reflog: fix memory leaks
reflog: fix memory leaks

Make sure to free the existing reflog when we run out or memory while
adding new entries.

Signed-off-by: schu <90bd52136ce4791fcc41c69bf9bb6c7db1f385bd@schulog.org>

rcorre/libgit2,mrksrm/Mingijura,rcorre/libgit2,zodiac/libgit2.js,maxiaoqian/libgit2,skabel/manguse,jamieleecool/ptest,sim0629/libgit2,claudelee/libgit2,stewid/libgit2,mingyaaaa/libgit2,amyvmiwei/libgit2,swisspol/DEMO-libgit2,magnus98/TEST,nokiddin/libgit2,kenprice/libgit2,chiayolin/libgit2,chiayolin/libgit2,maxiaoqian/libgit2,jflesch/libgit2-mariadb,yosefhackmon/libgit2,MrHacky/libgit2,mcanthony/libgit2,kissthink/libgit2,skabel/manguse,whoisj/libgit2,stewid/libgit2,nacho/libgit2,nokiddin/libgit2,Tousiph/Demo1,linquize/libgit2,amyvmiwei/libgit2,t0xicCode/libgit2,stewid/libgit2,whoisj/libgit2,kenprice/libgit2,mcanthony/libgit2,Tousiph/Demo1,yongthecoder/libgit2,stewid/libgit2,kissthink/libgit2,yongthecoder/libgit2,Snazz2001/libgit2,mrksrm/Mingijura,mrksrm/Mingijura,claudelee/libgit2,Aorjoa/libgit2_maked_lib,saurabhsuniljain/libgit2,maxiaoqian/libgit2,sim0629/libgit2,linquize/libgit2,leoyanggit/libgit2,mrksrm/Mingijura,zodiac/libgit2.js,claudelee/libgit2,KTXSoftware/libgit2,jeffhostetler/public_libgit2,dleehr/libgit2,sim0629/libgit2,spraints/libgit2,falqas/libgit2,claudelee/libgit2,rcorre/libgit2,skabel/manguse,KTXSoftware/libgit2,jeffhostetler/public_libgit2,linquize/libgit2,KTXSoftware/libgit2,chiayolin/libgit2,JIghtuse/libgit2,jflesch/libgit2-mariadb,Aorjoa/libgit2_maked_lib,dleehr/libgit2,mingyaaaa/libgit2,Tousiph/Demo1,kissthink/libgit2,jamieleecool/ptest,saurabhsuniljain/libgit2,mingyaaaa/libgit2,falqas/libgit2,sygool/libgit2,mhp/libgit2,yosefhackmon/libgit2,Aorjoa/libgit2_maked_lib,stewid/libgit2,skabel/manguse,mcanthony/libgit2,skabel/manguse,t0xicCode/libgit2,nokiddin/libgit2,kenprice/libgit2,joshtriplett/libgit2,iankronquist/libgit2,mrksrm/Mingijura,evhan/libgit2,t0xicCode/libgit2,swisspol/DEMO-libgit2,mcanthony/libgit2,rcorre/libgit2,iankronquist/libgit2,swisspol/DEMO-libgit2,jeffhostetler/public_libgit2,leoyanggit/libgit2,MrHacky/libgit2,amyvmiwei/libgit2,magnus98/TEST,nacho/libgit2,jeffhostetler/public_libgit2,JIghtuse/libgit2,swisspol/DEMO-libgit2,magnus98/TEST,jeffhostetler/public_libgit2,sim0629/libgit2,spraints/libgit2,sygool/libgit2,ardumont/libgit2,mhp/libgit2,sygool/libgit2,yosefhackmon/libgit2,iankronquist/libgit2,rcorre/libgit2,joshtriplett/libgit2,joshtriplett/libgit2,t0xicCode/libgit2,spraints/libgit2,mingyaaaa/libgit2,maxiaoqian/libgit2,yosefhackmon/libgit2,falqas/libgit2,yosefhackmon/libgit2,falqas/libgit2,oaastest/libgit2,rcorre/libgit2,dleehr/libgit2,JIghtuse/libgit2,Tousiph/Demo1,oaastest/libgit2,yosefhackmon/libgit2,nacho/libgit2,spraints/libgit2,jamieleecool/ptest,Snazz2001/libgit2,saurabhsuniljain/libgit2,kenprice/libgit2,kenprice/libgit2,iankronquist/libgit2,sygool/libgit2,KTXSoftware/libgit2,amyvmiwei/libgit2,joshtriplett/libgit2,mhp/libgit2,magnus98/TEST,maxiaoqian/libgit2,swisspol/DEMO-libgit2,kissthink/libgit2,spraints/libgit2,zodiac/libgit2.js,ardumont/libgit2,evhan/libgit2,Tousiph/Demo1,amyvmiwei/libgit2,t0xicCode/libgit2,mcanthony/libgit2,raybrad/libit2,MrHacky/libgit2,raybrad/libit2,raybrad/libit2,falqas/libgit2,kissthink/libgit2,since2014/libgit2,KTXSoftware/libgit2,ardumont/libgit2,whoisj/libgit2,mcanthony/libgit2,jeffhostetler/public_libgit2,Snazz2001/libgit2,mingyaaaa/libgit2,JIghtuse/libgit2,Corillian/libgit2,swisspol/DEMO-libgit2,leoyanggit/libgit2,oaastest/libgit2,magnus98/TEST,sygool/libgit2,iankronquist/libgit2,MrHacky/libgit2,sim0629/libgit2,mhp/libgit2,linquize/libgit2,saurabhsuniljain/libgit2,mrksrm/Mingijura,Corillian/libgit2,dleehr/libgit2,zodiac/libgit2.js,MrHacky/libgit2,nokiddin/libgit2,mhp/libgit2,raybrad/libit2,leoyanggit/libgit2,since2014/libgit2,jflesch/libgit2-mariadb,oaastest/libgit2,ardumont/libgit2,since2014/libgit2,magnus98/TEST,JIghtuse/libgit2,Snazz2001/libgit2,nokiddin/libgit2,claudelee/libgit2,jflesch/libgit2-mariadb,jflesch/libgit2-mariadb,JIghtuse/libgit2,sim0629/libgit2,sygool/libgit2,joshtriplett/libgit2,Corillian/libgit2,joshtriplett/libgit2,whoisj/libgit2,yongthecoder/libgit2,Aorjoa/libgit2_maked_lib,chiayolin/libgit2,evhan/libgit2,Tousiph/Demo1,yongthecoder/libgit2,leoyanggit/libgit2,yongthecoder/libgit2,mhp/libgit2,whoisj/libgit2,jamieleecool/ptest,amyvmiwei/libgit2,dleehr/libgit2,skabel/manguse,stewid/libgit2,kenprice/libgit2,Corillian/libgit2,raybrad/libit2,Corillian/libgit2,leoyanggit/libgit2,chiayolin/libgit2,saurabhsuniljain/libgit2,maxiaoqian/libgit2,oaastest/libgit2,Snazz2001/libgit2,claudelee/libgit2,iankronquist/libgit2,zodiac/libgit2.js,oaastest/libgit2,t0xicCode/libgit2,nacho/libgit2,chiayolin/libgit2,saurabhsuniljain/libgit2,Aorjoa/libgit2_maked_lib,kissthink/libgit2,since2014/libgit2,yongthecoder/libgit2,evhan/libgit2,spraints/libgit2,since2014/libgit2,Corillian/libgit2,ardumont/libgit2,linquize/libgit2,since2014/libgit2,jflesch/libgit2-mariadb,whoisj/libgit2,Snazz2001/libgit2,nokiddin/libgit2,linquize/libgit2,dleehr/libgit2,ardumont/libgit2,MrHacky/libgit2,falqas/libgit2,mingyaaaa/libgit2,KTXSoftware/libgit2