mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-23 15:49:23 +00:00
* grub-core/term/serial.c (grub_serial_register): Fix invalid free.
Ensure that pointers are inited to NULL and that pointers are not accessed after free.
This commit is contained in:
1 parent
5ae584c0b0
commit
9afe2053c9
2 files changed
+8
-3
No files matched your search
@@ -1,3 +1,8 @@
|
||||
2014-01-26 Vladimir Serbinenko <phcoder@gmail.com>
|
||||
|
||||
* grub-core/term/serial.c (grub_serial_register): Fix invalid free.
|
||||
Ensure that pointers are inited to NULL and that pointers are not
|
||||
accessed after free.
|
||||
|
||||
2014-01-25 Andrey Borzenkov <arvidjaar@gmail.com>
|
||||
|
||||
|
||||
@@ -339,22 +339,22 @@ grub_serial_register (struct grub_serial_port *port)
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
out = grub_malloc (sizeof (*out));
|
||||
out = grub_zalloc (sizeof (*out));
|
||||
if (!out)
|
||||
{
|
||||
grub_free (in);
|
||||
grub_free (indata);
|
||||
grub_free ((char *) in->name);
|
||||
grub_free (in);
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
outdata = grub_malloc (sizeof (*outdata));
|
||||
if (!outdata)
|
||||
{
|
||||
grub_free (in);
|
||||
grub_free (indata);
|
||||
grub_free ((char *) in->name);
|
||||
grub_free (out);
|
||||
grub_free (in);
|
||||
return grub_errno;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user