[PATCH v2] rpc: fix memory leak in virNetServerClientNew and virNetServerProgramDispatchCall

Michal Prívozník mprivozn at redhat.com
Fri Sep 30 07:02:49 UTC 2022


On 9/30/22 04:32, Jiang Jiacheng wrote:
> I see, maybe we could free dispatcher->arg_filter and
> dispatcher->ret_filter together in error label like this:
> error:
>     if (dispatcher) {
>         xdr_free(dispatcher->arg_filter, arg);
>         xdr_free(dispatcher->ret_filter, ret);
>     }
> and in successful path, we can free them before return.

Yes, this is what I tested just before suggesting it.

Michal



More information about the libvir-list mailing list