Hello Mansour
The related functions defined by the RingLibuv extension are
* new_sockaddr_in
* new_managed_sockaddr_in
* destroy_sockaddr_in
Thanks for the report :D
>> "I solved the issue by just nullifying the addr variable (addr = NULL) and escaping the function altogether."
(1) If the structure memory is allocated using new_sockaddr_in() then using destroy_sockaddr_in() is important to avoid a memory leak.
(2) If the structure memory is allocated using new_managed_sockaddr_in() then no need to call destroy function and Ring VM will manage the pointer and free memory automatically (using reference counting)
Greetings,
Mahmoud