From 452a562bf76bb89335379723b4ec1f31319088a4 Mon Sep 17 00:00:00 2001 From: sachiel Date: Thu, 16 Apr 2009 04:52:33 +0000 Subject: [PATCH] Don't leak, and be consistent with return values. git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/evas@40101 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/engines/common/evas_font_draw.c | 2 +- src/lib/engines/common/evas_intl_utils.c | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lib/engines/common/evas_font_draw.c b/src/lib/engines/common/evas_font_draw.c index 0c833ef..bc8c4b3 100644 --- a/src/lib/engines/common/evas_font_draw.c +++ b/src/lib/engines/common/evas_font_draw.c @@ -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); } diff --git a/src/lib/engines/common/evas_intl_utils.c b/src/lib/engines/common/evas_intl_utils.c index 6ad1b45..6fcc099 100644 --- a/src/lib/engines/common/evas_intl_utils.c +++ b/src/lib/engines/common/evas_intl_utils.c @@ -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 */ -- 2.7.4