fixed nil pointer
This commit is contained in:
parent
8b15c38eab
commit
aac88a8fad
1 changed files with 4 additions and 1 deletions
5
alloc.go
5
alloc.go
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue