fix coverity issues 63/177863/2 accepted/tizen/unified/20180504.162657 submit/tizen/20180504.062252
authorYoungjae Shin <yj99.shin@samsung.com>
Fri, 4 May 2018 05:22:25 +0000 (14:22 +0900)
committerYoungjae Shin <yj99.shin@samsung.com>
Fri, 4 May 2018 06:14:20 +0000 (15:14 +0900)
Change-Id: Ice20660fb81afafa1ce449862a2afe2ab6baf0a1

imap-2007e/c-client/imap4r1.c
imap-2007e/c-client/mail.c
imap-2007e/c-client/pop3.c
packaging/uw-imap-toolkit.spec

index 050c234..8002332 100755 (executable)
@@ -3469,6 +3469,8 @@ IMAPPARSEDREPLY *imap_send (MAILSTREAM *stream,char *cmd,IMAPARG *args[])
                                                sprintf (s," %lu",list->text.size);
                                                s += strlen (s);
                                                c = ' ';                /* prefix character for subsequent strings */
+                                       } else {
+                                               break;
                                        }
                                } while (list = list->next);
 
index bab7ecf..9020b68 100755 (executable)
@@ -3038,7 +3038,7 @@ long mail_parse_date (MESSAGECACHE *elt,unsigned char *s)
     if (isdigit (s[1])) {      /* possible ISO 8601 date format? */
       y = m;                   /* yes, first number is year */
                                /* get month and day */
-      if ((m = strtoul (s+1,(char **) &s,10)) && (*s++ == '-') && 
+      if ((m = strtoul (s+1,(char **) &s,10)) && (*s++ == '-') &&
          (d = strtoul (s,(char **) &s,10)) && !*s) break;
       return NIL;              /* syntax error or time present */
     }
@@ -3368,7 +3368,7 @@ void mail_lock (MAILSTREAM *stream)
 /* Mail unlock stream
  * Accepts: mail stream
  */
+
 void mail_unlock (MAILSTREAM *stream)
 {
   if (!stream->lock) MM_FATAL ("Unlock when not locked");
@@ -4677,6 +4677,7 @@ SORTCACHE **mail_sort_loadcache (MAILSTREAM *stream,SORTPGM *pgm)
        break;
       default:
        MM_FATAL ("Unknown sort function");
+       free (sc);
        return NIL;
       }
     }
index caf862e..43a81cf 100755 (executable)
@@ -632,8 +632,10 @@ long pop3_auth (MAILSTREAM *stream,NETMBX *mb,char *pwd,char *usr, int apop)
        if(pop3_send(stream, "APOP", tmp)) {
                MM_LOG("successfully logged in using APOP", NIL);
                pop3_capa (stream,flags);
+               free (tmp);
                return LONGT;
        }
+       free (tmp);
   }
   long capaok = pop3_capa (stream,flags);
   NETDRIVER *ssld = (NETDRIVER *) mail_parameters (NIL,GET_SSLDRIVER,NIL);
index 6410510..8b86087 100644 (file)
@@ -44,6 +44,8 @@ IMAP-2007e development library for E-mail Framework
 cp %{SOURCE1001} %{SOURCE1002} .
 
 %build
+# for ignoring warning messages(It is opensource)
+export CFLAGS="$CFLAGS -Wno-unused-result -Wno-pointer-sign -Wno-unused-function -Wno-parentheses -Wmisleading-indentation -Wno-unused-variable -Wno-unused-variable -Wno-unused-value -Wno-cpp"
 ./autogen.sh
 %configure --disable-static