• M
    Fix memory leaks in libvirtd's message processing · c6f1459e
    Matthias Bolte 提交于
    Commit 47cab734 changed the way how
    qemud_client_message objects were reused. Before this commit
    remoteDispatchClientRequest() reused the received message for normal responses
    and to report non-fatal errors. If a fatal error occurred qemudWorker() frees
    the message. After this commit non-fatal errors are reported by
    remoteSerializeReplyError() using a new qemud_client_message object and the
    original message leaks.
    
    To fix this leak the original message has to be freed if
    remoteSerializeReplyError() succeeds. If remoteSerializeReplyError()
    fails the original message is freed in qemudWorker().
    
    * daemon/dispatch.c: free qemud_client_message objects that will not be reused
      and would leak otherwise, also free the allocated qemud_client_message object
      in remoteSerializeError() if an error occurs
    c6f1459e
dispatch.c 18.5 KB