diff options
author | Vivek Ellur <vivek.ellur@samsung.com> | 2015-11-10 12:26:14 -0500 |
---|---|---|
committer | Mike Blumenkrantz <zmike@osg.samsung.com> | 2015-11-10 12:26:14 -0500 |
commit | f026fdf9b345837d1145f657b2c8ef04765acc60 (patch) | |
tree | 97ad0d8ecd8e900a313b3905e65066eeb9fb67a3 | |
parent | bd0c590489a7ae1c3185578389f19bde4bacbcff (diff) | |
download | enlightenment-f026fdf9b345837d1145f657b2c8ef04765acc60.tar.gz |
e: Fix realloc issue in e font module
Summary:
@Fix
Signed-off-by: Vivek Ellur <vivek.ellur@samsung.com>
Reviewers: zmike
Subscribers: cedric
Differential Revision: https://phab.enlightenment.org/D3306
-rw-r--r-- | src/bin/e_font.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/bin/e_font.c b/src/bin/e_font.c index e1f4e743a1..81423aca60 100644 --- a/src/bin/e_font.c +++ b/src/bin/e_font.c @@ -159,7 +159,7 @@ _e_font_fontconfig_name_parse(Eina_Hash **font_hash, E_Font_Properties *efp, con s1 = strchr(font, ':'); if (s1) { - char *s2, *name, *style; + char *s2, *name, *style, *temp; int len; len = s1 - font; @@ -171,7 +171,13 @@ _e_font_fontconfig_name_parse(Eina_Hash **font_hash, E_Font_Properties *efp, con if (s2) { len = s2 - name; + temp = name; name = realloc(name, sizeof(char) * len + 1); + if (!name) + { + free(temp); + return NULL; + } memset(name, 0, sizeof(char) * len + 1); strncpy(name, font, len); } |