kimcinoo pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=d53e46d76f3eb4f3face03f1f39d0b4a9e7aece3

commit d53e46d76f3eb4f3face03f1f39d0b4a9e7aece3
Author: Taehyub Kim <taehyub....@samsung.com>
Date:   Mon Aug 26 14:50:44 2019 +0900

    efl_ui_format: add null checking codes for eina_strftime in 
_do_format_string function
    
    Summary: efl_ui_format: add null checking codes for eina_strftime in 
_do_format_string function
    
    Reviewers: kimcinoo
    
    Subscribers: cedric, #reviewers, #committers
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D9735
---
 src/lib/elementary/efl_ui_format.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/src/lib/elementary/efl_ui_format.c 
b/src/lib/elementary/efl_ui_format.c
index 2dff332409..7e3ce115d3 100644
--- a/src/lib/elementary/efl_ui_format.c
+++ b/src/lib/elementary/efl_ui_format.c
@@ -136,11 +136,14 @@ _do_format_string(Efl_Ui_Format_Data *pd, Eina_Strbuf 
*str, const Eina_Value val
       case FORMAT_TYPE_TM:
       {
         struct tm v;
-        char *buf;
+        char *buf = NULL;
         eina_value_get(&value, &v);
         buf = eina_strftime(pd->format_string, &v);
-        eina_strbuf_append(str, buf);
-        free(buf);
+        if (buf)
+          {
+             eina_strbuf_append(str, buf);
+             free(buf);
+          }
         break;
       }
       default:

-- 


Reply via email to