diff mbox

[v2] spice: fix memory leak

Message ID 1423673410-15100-1-git-send-email-kraxel@redhat.com
State New
Headers show

Commit Message

Gerd Hoffmann Feb. 11, 2015, 4:50 p.m. UTC
Found by coverity.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
---
 monitor.c | 1 +
 1 file changed, 1 insertion(+)

Comments

Gonglei (Arei) Feb. 12, 2015, 2:14 a.m. UTC | #1
On 2015/2/12 0:50, Gerd Hoffmann wrote:
> Found by coverity.
> 
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  monitor.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/monitor.c b/monitor.c
> index c3cc060..2c37953 100644
> --- a/monitor.c
> +++ b/monitor.c
> @@ -1101,6 +1101,7 @@ static int client_migrate_info(Monitor *mon, const QDict *qdict,
>      if (strcmp(protocol, "spice") == 0) {
>          if (!qemu_using_spice(&err)) {
>              qerror_report_err(err);
> +            error_free(err);
>              return -1;
>          }
>  
> 
Hi, Gerd
the err variable should be initialized to NULL.

This leak had been fixed by:
http://patchwork.ozlabs.org/patch/438696/

and v2:
[PATCH v2] monitor: Fix missing err = NULL in client_migrate_info()

Regards,
-Gonglei
diff mbox

Patch

diff --git a/monitor.c b/monitor.c
index c3cc060..2c37953 100644
--- a/monitor.c
+++ b/monitor.c
@@ -1101,6 +1101,7 @@  static int client_migrate_info(Monitor *mon, const QDict *qdict,
     if (strcmp(protocol, "spice") == 0) {
         if (!qemu_using_spice(&err)) {
             qerror_report_err(err);
+            error_free(err);
             return -1;
         }