Call to os.Exit or log.Fatal and friends made in function using defer CRT-D0011
Bug risk
Major
2 occurrences in this check
log.Fatal will exit, and defer func(){...}(...) will not run
255	buf := []byte(fdContent)
256	_, err = fd.Write(buf)
257	if err != nil {
258		log.Fatal(err)259	}
260}
261
log.Fatal will exit, and defer c.mutex.Unlock() will not run
 97		}
 98		delete(c.regionMap, regionID)
 99	} else {
100		log.Fatal("error when add sourceStore in transfer region map", zap.Uint64("source-store", sourceStoreID), zap.Uint64("region", regionID))101	}
102}
103