git/pack: check pf->pack for nil before Bterming it

This commit is contained in:
Sigrid Solveig Haflínudóttir 2021-10-28 15:26:57 +00:00
parent 18521fc8c6
commit 35a8152ebc

View file

@ -281,7 +281,7 @@ openpack(Packf *pf)
static void
closepack(Packf *pf)
{
if(--pf->refs == 0){
if(--pf->refs == 0 && pf->pack != nil){
Bterm(pf->pack);
pf->pack = nil;
}