Fixed potential SEGFAULT in socket_base.cpp