• N
    rpc: client stream: dispose private data on stream dispose · fbcb7386
    Nikolay Shirokovskiy 提交于
    If we call virStreamFinish and virStreamAbort from 2 distinct
    threads for example we can have access to freed memory.
    Because when virStreamFinish finishes for example virStreamAbort
    yet to be finished and it access virNetClientStreamPtr object
    in stream->privateData.
    
    Also it does not make sense to clear @driver field. After
    stream is finished/aborted it is better to have appropriate
    error message instead of "unsupported error".
    
    This commit reverts [1] or virNetClientStreamPtr and
    virStreamPtr will never be unrefed due to cyclic dependency.
    Before this patch we don't have leaks because all execution
    paths we call virStreamFinish or virStreamAbort.
    
    [1] 8b6ffe40 : virNetClientStreamNew: Track origin stream
    Signed-off-by: NNikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>
    fbcb7386
remote_driver.c 290.8 KB