mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-26 03:21:44 +03:00
Fix leak of 'msg' object in client stream code
In one exit path we forgot to free the virNetMessage object causing a large memory leak for streams which send a lot of data. Some other paths were calling VIR_FREE directly instead of virNetMessageFree although this was (currently) harmless. * src/rpc/virnetclientstream.c: Fix leak of msg object * src/rpc/virnetclientprogram.c: Call virNetMessageFree instead of VIR_FREE
This commit is contained in:
parent
3e5d48ef33
commit
927dfcf693
@ -329,11 +329,11 @@ int virNetClientProgramCall(virNetClientProgramPtr prog,
|
||||
goto error;
|
||||
}
|
||||
|
||||
VIR_FREE(msg);
|
||||
virNetMessageFree(msg);
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
VIR_FREE(msg);
|
||||
virNetMessageFree(msg);
|
||||
return -1;
|
||||
}
|
||||
|
@ -361,11 +361,12 @@ int virNetClientStreamSendPacket(virNetClientStreamPtr st,
|
||||
if (virNetClientSend(client, msg, wantReply) < 0)
|
||||
goto error;
|
||||
|
||||
virNetMessageFree(msg);
|
||||
|
||||
return nbytes;
|
||||
|
||||
error:
|
||||
VIR_FREE(msg);
|
||||
virNetMessageFree(msg);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user