[Spice-devel] [PATCH spice-server 05/10] reds: fix memory leak when core->base.minor_version < 3
Marc-André Lureau
marcandre.lureau at gmail.com
Wed May 8 07:46:33 PDT 2013
ack (I am really scared by this conditional free there!! it's a recipe for
disasters)
On Wed, May 8, 2013 at 4:06 PM, Yonit Halperin <yhalperi at redhat.com> wrote:
> ---
> server/reds.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/server/reds.c b/server/reds.c
> index a378f80..f6a1ce9 100644
> --- a/server/reds.c
> +++ b/server/reds.c
> @@ -196,10 +196,9 @@ static void reds_stream_push_channel_event(RedsStream
> *s, int event)
>
> void reds_handle_channel_event(int event, SpiceChannelEventInfo *info)
> {
> - if (core->base.minor_version < 3 || core->channel_event == NULL)
> - return;
> + if (core->base.minor_version >= 3 && core->channel_event != NULL)
> + core->channel_event(event, info);
>
> - core->channel_event(event, info);
> if (event == SPICE_CHANNEL_EVENT_DISCONNECTED) {
> free(info);
> }
> --
> 1.8.1.4
>
> _______________________________________________
> Spice-devel mailing list
> Spice-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/spice-devel
>
--
Marc-André Lureau
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/spice-devel/attachments/20130508/eebd8bb2/attachment.html>
More information about the Spice-devel
mailing list