Coverity issue resolved 64/281864/1 accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix accepted/tizen_8.0_unified tizen_7.0 tizen_7.0_hotfix tizen_8.0 accepted/tizen/7.0/unified/20221110.061030 accepted/tizen/7.0/unified/hotfix/20221116.111525 accepted/tizen/8.0/unified/20231005.095635 accepted/tizen/unified/20220923.125154 tizen_7.0_m2_release tizen_8.0_m2_release
authorKrishna Kant Jaju <krishna.jaju@samsung.com>
Thu, 22 Sep 2022 15:06:40 +0000 (20:36 +0530)
committerKrishna Kant Jaju <krishna.jaju@samsung.com>
Thu, 22 Sep 2022 15:07:27 +0000 (20:37 +0530)
Change-Id: If802fe5bad2794a58a17d53b719474cd2a095e25
Signed-off-by: Krishna Kant Jaju <krishna.jaju@samsung.com>
imap-2007e/c-client/utf8aux.c

index 5138987..6ed7cfa 100755 (executable)
@@ -41,9 +41,9 @@ static void utf8_stringlist (STRINGLIST *st,char *charset)
   SIZEDTEXT txt;
                                /* convert entire stringstruct */
   if (st) do if (utf8_text (&st->text,charset,&txt,U8T_CANONICAL)) {
-    fs_give ((void **) &st->text.data);
     st->text.data = txt.data; /* transfer this text */
     st->text.size = txt.size;
+       fs_give ((void **) &st->text.data);
   } while (st = st->next);
 }
 
@@ -72,9 +72,9 @@ void utf8_searchpgm (SEARCHPGM *pgm,char *charset)
        hl->line.size = txt.size;
       }
       if (utf8_text (&hl->text,charset,&txt,U8T_CANONICAL)) {
-       fs_give ((void **) &hl->text.data);
        hl->text.data = txt.data;
        hl->text.size = txt.size;
+       fs_give ((void **) &hl->text.data);
       }
     }
     utf8_stringlist (pgm->body,charset);