[Tizen] Fixed reported SVACE error in hyphenation-impl.cpp 64/258864/1
authorAdeel Kazmi <adeel.kazmi@samsung.com>
Tue, 11 May 2021 09:01:01 +0000 (10:01 +0100)
committerBowon Ryu <bowon.ryu@samsung.com>
Wed, 26 May 2021 06:16:46 +0000 (15:16 +0900)
Change-Id: I6a7bc8ce2abeae871cd294477ebb1458eb53bb36

dali/internal/text/text-abstraction/hyphenation-impl.cpp

index eef2fe9..bc460ee 100644 (file)
@@ -165,17 +165,19 @@ struct Hyphenation::Plugin
     }
 
     hyphens = (char*)malloc(wordLength + 5);
+    if(hyphens)
+    {
+      hnj_hyphen_hyphenate2(dict, (char*)(word), wordLength, hyphens, NULL, &rep, &pos, &cut);
 
-    hnj_hyphen_hyphenate2(dict, (char*)(word), wordLength, hyphens, NULL, &rep, &pos, &cut);
+      hyphensList.PushBack(false);
 
-    hyphensList.PushBack(false);
+      for(Length i = 0; i < wordLength - 1; i++)
+      {
+        hyphensList.PushBack((bool)(hyphens[i + 1] & 1));
+      }
 
-    for(Length i = 0; i < wordLength - 1; i++)
-    {
-      hyphensList.PushBack((bool)(hyphens[i + 1] & 1));
+      free(hyphens);
     }
-
-    free(hyphens);
 #endif
 
     return hyphensList;