Fix few memory errors
This commit is contained in:
parent
7c464a1ec5
commit
eaa1f9a64b
3 changed files with 13 additions and 8 deletions
|
@ -63,10 +63,10 @@ grub_font_draw_string (const char *str, grub_font_t font,
|
|||
if (!glyph)
|
||||
return grub_errno;
|
||||
err = grub_font_draw_glyph (glyph, color, x, baseline_y);
|
||||
x += glyph->device_width;
|
||||
grub_free (glyph);
|
||||
if (err)
|
||||
return err;
|
||||
x += glyph->device_width;
|
||||
}
|
||||
|
||||
grub_free (visual);
|
||||
|
|
|
@ -130,6 +130,8 @@ grub_unicode_glyph_dup (const struct grub_unicode_glyph *in)
|
|||
if (!out)
|
||||
return NULL;
|
||||
grub_memcpy (out, in, sizeof (*in));
|
||||
if (in->combining)
|
||||
{
|
||||
out->combining = grub_malloc (in->ncomb * sizeof (*in));
|
||||
if (!out->combining)
|
||||
{
|
||||
|
@ -137,6 +139,7 @@ grub_unicode_glyph_dup (const struct grub_unicode_glyph *in)
|
|||
return NULL;
|
||||
}
|
||||
grub_memcpy (out->combining, in->combining, in->ncomb * sizeof (*in));
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
|
|
|
@ -282,6 +282,7 @@ grub_utf8_to_ucs4_alloc (const char *msg, grub_uint32_t **unicode_msg,
|
|||
msg_len = grub_utf8_to_ucs4 (*unicode_msg, msg_len,
|
||||
(grub_uint8_t *) msg, -1, 0);
|
||||
|
||||
if (last_position)
|
||||
*last_position = *unicode_msg + msg_len;
|
||||
|
||||
return msg_len;
|
||||
|
@ -536,6 +537,7 @@ grub_unicode_aglomerate_comb (const grub_uint32_t *in, grub_size_t inlen,
|
|||
grub_errno = GRUB_ERR_NONE;
|
||||
continue;
|
||||
}
|
||||
out->combining = n;
|
||||
|
||||
for (j = last_comb_pointer; j < out->ncomb; j++)
|
||||
if (out->combining[j].type > comb_type)
|
||||
|
|
Loading…
Reference in a new issue