Skip to contentSkip to conversation

chardev/baum: fix baum that releases brlapi twice

PATCH Applied Liang Yan 3 participants 3 messages Sep 22, 2017 – Sep 24, 2017

lore
Share & tools
lore

Liang Yan

author
#0 lore raw

PATCH 1/1 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)"

---
 chardev/baum.c | 1 +
 1 file changed, 1 insertion(+)
chardev/baum.c +1 -0
index 302dd9666c..67fd783a59 100644
@@ -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;
Signature · 1 line
2.14.1
Reviewed-by on v1 1/1
#1 lore raw

----- Original Message -----

Quoted 5 lines

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)"

Quoted 20 lines
---
 chardev/baum.c | 1 +
 1 file changed, 1 insertion(+)
chardev/baum.c +1 -1
index 302dd9666c..67fd783a59 100644
@@ -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;
--

2.14.1

#2 lore raw
In reply to Liang Yan
Quoted 3 lines · Liang Yan

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)"

Applied to -trivial, thanks!

/mjt