use-go / onvif

full and enhanced onvif protocol stack in golang.
MIT License
384 stars 180 forks source link

Fix panic during SendProbe #11

Closed GreenLightning closed 2 years ago

GreenLightning commented 2 years ago

If ListenPacket returns an error, c is nil and the deferred call to c.Close() will panic.

Fix this by returning early from the method.

This happens for example if the address is already in use (e.g. two processes trying to run SendProbe concurrently).

crazybber commented 2 years ago

thx