[v2,1/1] display/bochs-display: fix memory leak
diff mbox series

Message ID d6c26e68db134c7b0c7ce8b61596ca2e65e01e12.1576013209.git.dirty@apple.com
State New
Headers show
Series
  • Fix bochs memory leak
Related show

Commit Message

Keith Packard" via Dec. 10, 2019, 9:27 p.m. UTC
Fix memory leak in bochs_display_update().  Leaks 304 bytes per frame.

Signed-off-by: Cameron Esfahani <dirty@apple.com>
---
 hw/display/bochs-display.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Philippe Mathieu-Daudé Dec. 10, 2019, 11:16 p.m. UTC | #1
On 12/10/19 10:27 PM, Cameron Esfahani via wrote:
> Fix memory leak in bochs_display_update().  Leaks 304 bytes per frame.
> 
> Signed-off-by: Cameron Esfahani <dirty@apple.com>

Funny to have a dirty@ email fixing a DirtyBitmapSnapshot leak =)

Fixes: 33ebad54056
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>   hw/display/bochs-display.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/hw/display/bochs-display.c b/hw/display/bochs-display.c
> index dc1bd1641d..215db9a231 100644
> --- a/hw/display/bochs-display.c
> +++ b/hw/display/bochs-display.c
> @@ -252,6 +252,8 @@ static void bochs_display_update(void *opaque)
>               dpy_gfx_update(s->con, 0, ys,
>                              mode.width, y - ys);
>           }
> +
> +        g_free(snap);
>       }
>   }
>   
>
Aleksandar Markovic Dec. 10, 2019, 11:28 p.m. UTC | #2
On Wednesday, December 11, 2019, Philippe Mathieu-Daudé <philmd@redhat.com>
wrote:

> On 12/10/19 10:27 PM, Cameron Esfahani via wrote:
>
>> Fix memory leak in bochs_display_update().  Leaks 304 bytes per frame.
>>
>> Signed-off-by: Cameron Esfahani <dirty@apple.com>
>>
>
> Funny to have a dirty@ email fixing a DirtyBitmapSnapshot leak =)
>
> Fixes: 33ebad54056


Dirty fixing bad in a snap. What a fix. :-o


> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
>
> ---
>>   hw/display/bochs-display.c | 2 ++
>>   1 file changed, 2 insertions(+)
>>
>> diff --git a/hw/display/bochs-display.c b/hw/display/bochs-display.c
>> index dc1bd1641d..215db9a231 100644
>> --- a/hw/display/bochs-display.c
>> +++ b/hw/display/bochs-display.c
>> @@ -252,6 +252,8 @@ static void bochs_display_update(void *opaque)
>>               dpy_gfx_update(s->con, 0, ys,
>>                              mode.width, y - ys);
>>           }
>> +
>> +        g_free(snap);
>>       }
>>   }
>>
>>
>
>
>
Philippe Mathieu-Daudé Dec. 10, 2019, 11:35 p.m. UTC | #3
On 12/11/19 12:28 AM, Aleksandar Markovic wrote:
> 
> On Wednesday, December 11, 2019, Philippe Mathieu-Daudé 
> <philmd@redhat.com <mailto:philmd@redhat.com>> wrote:
> 
>     On 12/10/19 10:27 PM, Cameron Esfahani via wrote:
> 
>         Fix memory leak in bochs_display_update().  Leaks 304 bytes per
>         frame.
> 
>         Signed-off-by: Cameron Esfahani <dirty@apple.com
>         <mailto:dirty@apple.com>>
> 
> 
>     Funny to have a dirty@ email fixing a DirtyBitmapSnapshot leak =)
> 
>     Fixes: 33ebad54056
> 
> 
> Dirty fixing bad in a snap. What a fix. :-o

Nice one! =)

Patch
diff mbox series

diff --git a/hw/display/bochs-display.c b/hw/display/bochs-display.c
index dc1bd1641d..215db9a231 100644
--- a/hw/display/bochs-display.c
+++ b/hw/display/bochs-display.c
@@ -252,6 +252,8 @@  static void bochs_display_update(void *opaque)
             dpy_gfx_update(s->con, 0, ys,
                            mode.width, y - ys);
         }
+
+        g_free(snap);
     }
 }