From: Liang Yan Date: Fri, 22 Sep 2017 22:55:33 +0000 (-0400) Subject: chardev/baum: fix baum that releases brlapi twice X-Git-Tag: v2.11.0-rc0~79^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=98e8790326d732fc79f0c133d9658f4761ba9cb7;p=thirdparty%2Fqemu.git chardev/baum: fix baum that releases brlapi twice 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 Reviewed-by: Marc-André Lureau Signed-off-by: Michael Tokarev --- diff --git a/chardev/baum.c b/chardev/baum.c index 302dd9666c0..67fd783a599 100644 --- a/chardev/baum.c +++ b/chardev/baum.c @@ -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;