Fix few memory errors
This commit is contained in:
parent
7c464a1ec5
commit
eaa1f9a64b
3 changed files with 13 additions and 8 deletions
|
@ -130,13 +130,16 @@ grub_unicode_glyph_dup (const struct grub_unicode_glyph *in)
|
|||
if (!out)
|
||||
return NULL;
|
||||
grub_memcpy (out, in, sizeof (*in));
|
||||
out->combining = grub_malloc (in->ncomb * sizeof (*in));
|
||||
if (!out->combining)
|
||||
if (in->combining)
|
||||
{
|
||||
grub_free (out);
|
||||
return NULL;
|
||||
out->combining = grub_malloc (in->ncomb * sizeof (*in));
|
||||
if (!out->combining)
|
||||
{
|
||||
grub_free (out);
|
||||
return NULL;
|
||||
}
|
||||
grub_memcpy (out->combining, in->combining, in->ncomb * sizeof (*in));
|
||||
}
|
||||
grub_memcpy (out->combining, in->combining, in->ncomb * sizeof (*in));
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue