fixed nil pointer

This commit is contained in:
ston1th 2021-09-26 19:30:58 +02:00
commit aac88a8fad

View file

@ -64,7 +64,10 @@ func (a *GenericAlloc) Alloc() (ip *net.IPAddr, err error) {
func (a *GenericAlloc) AllocCIDR() (cidr string, err error) { func (a *GenericAlloc) AllocCIDR() (cidr string, err error) {
ip, err := a.Alloc() ip, err := a.Alloc()
return CIDR(a.prefix, ip), err if err != nil {
return
}
return CIDR(a.prefix, ip), nil
} }
func (a *GenericAlloc) Free(ip *net.IPAddr) (err error) { func (a *GenericAlloc) Free(ip *net.IPAddr) (err error) {