Don't leak, and be consistent with return values.

SVN revision: 40101
This commit is contained in:
Iván Briano 2009-04-16 04:52:33 +00:00
parent 8292408792
commit 994190d144
2 changed files with 6 additions and 3 deletions

View File

@ -388,7 +388,7 @@ evas_common_font_draw_internal(RGBA_Image *dst, RGBA_Draw_Context *dc, RGBA_Font
prev_index = index;
}
#ifdef INTERNATIONAL_SUPPORT
if (bidi_err < 0) {
if (bidi_err >= 0) {
free(level_list);
free(text);
}

View File

@ -29,8 +29,11 @@ evas_intl_utf8_to_visual(const char *text, int *ret_len, FriBidiCharType *direct
/* if there's nothing to do, return text
* one char draws are quite common */
if (len <= 1)
return text;
if (len <= 1) {
*ret_len = len;
*embedding_level_list = NULL;
return strdup(text);
}
byte_len = strlen(text); /* we need the actual number of bytes, not number of chars */