NOEXPORT void socket_options_free(SOCK_OPT *opt) {
    SOCK_OPT *ptr;
    if(!opt) {
        s_log(LOG_ERR, "INTERNAL ERROR: Socket options not initialized");
        return;
    }
    for(ptr=opt; ptr->opt_str; ++ptr) {
        int type;
        for(type=0; type<3; ++type)
            str_free(ptr->opt_val[type]);
    }
    str_free(opt);
}
NOEXPORT void socket_options_free(SOCK_OPT *opt) {
    SOCK_OPT *ptr;
    if(!opt) {
        s_log(LOG_ERR, "INTERNAL ERROR: Socket options not initialized");
        return;
    }
    for(ptr=opt; ptr->opt_str; ++ptr) {
        int type;
        for(type=0; type<3; ++type)
            str_free(ptr->opt_val[type]);
    }
    str_free(opt);
}