int dtls1_new(SSL *s)
{
    DTLS1_STATE *d1;
    if (!DTLS_RECORD_LAYER_new(&s->rlayer)) {
        return 0;
    }
    if (!ssl3_new(s))
        return (0);
    if ((d1 = OPENSSL_zalloc(sizeof(*d1))) == NULL) {
        ssl3_free(s);
        return (0);
    }
    d1->buffered_messages = pqueue_new();
    d1->sent_messages = pqueue_new();
    if (s->server) {
        d1->cookie_len = sizeof(s->d1->cookie);
    }
    d1->link_mtu = 0;
    d1->mtu = 0;
    if (d1->buffered_messages == NULL || d1->sent_messages == NULL) {
        pqueue_free(d1->buffered_messages);
        pqueue_free(d1->sent_messages);
        OPENSSL_free(d1);
        ssl3_free(s);
        return (0);
    }
    s->d1 = d1;
    s->method->ssl_clear(s);
    return (1);
}
['int dtls1_new(SSL *s)\n{\n    DTLS1_STATE *d1;\n    if (!DTLS_RECORD_LAYER_new(&s->rlayer)) {\n        return 0;\n    }\n    if (!ssl3_new(s))\n        return (0);\n    if ((d1 = OPENSSL_zalloc(sizeof(*d1))) == NULL) {\n        ssl3_free(s);\n        return (0);\n    }\n    d1->buffered_messages = pqueue_new();\n    d1->sent_messages = pqueue_new();\n    if (s->server) {\n        d1->cookie_len = sizeof(s->d1->cookie);\n    }\n    d1->link_mtu = 0;\n    d1->mtu = 0;\n    if (d1->buffered_messages == NULL || d1->sent_messages == NULL) {\n        pqueue_free(d1->buffered_messages);\n        pqueue_free(d1->sent_messages);\n        OPENSSL_free(d1);\n        ssl3_free(s);\n        return (0);\n    }\n    s->d1 = d1;\n    s->method->ssl_clear(s);\n    return (1);\n}', 'int DTLS_RECORD_LAYER_new(RECORD_LAYER *rl)\n{\n    DTLS_RECORD_LAYER *d;\n    if ((d = OPENSSL_malloc(sizeof(*d))) == NULL)\n        return (0);\n    rl->d = d;\n    d->unprocessed_rcds.q = pqueue_new();\n    d->processed_rcds.q = pqueue_new();\n    d->buffered_app_data.q = pqueue_new();\n    if (d->unprocessed_rcds.q == NULL || d->processed_rcds.q == NULL\n        || d->buffered_app_data.q == NULL) {\n        pqueue_free(d->unprocessed_rcds.q);\n        pqueue_free(d->processed_rcds.q);\n        pqueue_free(d->buffered_app_data.q);\n        OPENSSL_free(d);\n        rl->d = NULL;\n        return (0);\n    }\n    return 1;\n}', 'void *CRYPTO_malloc(size_t num, const char *file, int line)\n{\n    void *ret = NULL;\n    if (num <= 0)\n        return NULL;\n    allow_customize = 0;\n#ifndef OPENSSL_NO_CRYPTO_MDEBUG\n    if (call_malloc_debug) {\n        CRYPTO_mem_debug_malloc(NULL, num, 0, file, line);\n        ret = malloc(num);\n        CRYPTO_mem_debug_malloc(ret, num, 1, file, line);\n    } else {\n        ret = malloc(num);\n    }\n#else\n    (void)file;\n    (void)line;\n    ret = malloc(num);\n#endif\n#ifndef OPENSSL_CPUID_OBJ\n    if (ret && (num > 2048)) {\n        extern unsigned char cleanse_ctr;\n        ((unsigned char *)ret)[0] = cleanse_ctr;\n    }\n#endif\n    return ret;\n}', 'pqueue *pqueue_new()\n{\n    pqueue *pq = OPENSSL_zalloc(sizeof(*pq));\n    return pq;\n}', 'void *CRYPTO_zalloc(size_t num, const char *file, int line)\n{\n    void *ret = CRYPTO_malloc(num, file, line);\n    if (ret != NULL)\n        memset(ret, 0, num);\n    return ret;\n}']