Language: C
Label: safe
CWE: CWE-416 \u2014 Use After Free
Referencing memory after it has been freed can cause a program to crash, use unexpected values, or execute code.

Code:
static void dtls_on_destroy(void *arg) {
    dtls_srtp *ds = (dtls_srtp *)arg;

    if (ds->ossl_lock)
        pj_lock_destroy(ds->ossl_lock);

    pj_pool_safe_release(&ds->pool);
}