]> git.proxmox.com Git - mirror_qemu.git/commitdiff
chardev/baum: fix baum that releases brlapi twice
authorLiang Yan <lyan@suse.com>
Fri, 22 Sep 2017 22:55:33 +0000 (18:55 -0400)
committerMichael Tokarev <mjt@tls.msk.ru>
Tue, 26 Sep 2017 06:11:22 +0000 (09:11 +0300)
Error process of baum_chr_open needs to set brlapi null, so it won't
get released twice in char_braille_finalize, which will cause
"/usr/bin/qemu-system-x86_64: double free or corruption (!prev)"

Signed-off-by: Liang Yan <lyan@suse.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
chardev/baum.c

index 302dd9666c0595bb25a1b8584fef1456f5838858..67fd783a5992eb1bca0b02f2ef702d73ba68251a 100644 (file)
@@ -643,6 +643,7 @@ static void baum_chr_open(Chardev *chr,
         error_setg(errp, "brlapi__openConnection: %s",
                    brlapi_strerror(brlapi_error_location()));
         g_free(handle);
+        baum->brlapi = NULL;
         return;
     }
     baum->deferred_init = 0;