[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] Potential problems in virFDStreamClose



virFDStreamClose calls virFDStreamFree that frees fdst, but
virFDStreamClose access fdst->lock after that.

virFDStreamClose doesn't destroy fdst->lock.

static int
virFDStreamClose(virStreamPtr st)
{
    struct virFDStreamData *fdst = st->privateData;
    int ret;

    VIR_DEBUG("st=%p", st);

    if (!fdst)
        return 0;

    virMutexLock(&fdst->lock);

    ret = virFDStreamFree(fdst);

    st->privateData = NULL;

    virMutexUnlock(&fdst->lock);

    return ret;
}

Matthias


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]