diff --git a/src/rpc/virnetclientprogram.c b/src/rpc/virnetclientprogram.c index 8414ad86e0..c39520abfd 100644 --- a/src/rpc/virnetclientprogram.c +++ b/src/rpc/virnetclientprogram.c @@ -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; } diff --git a/src/rpc/virnetclientstream.c b/src/rpc/virnetclientstream.c index d5efab12e5..fe15acdf61 100644 --- a/src/rpc/virnetclientstream.c +++ b/src/rpc/virnetclientstream.c @@ -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; }