nsgmls: resolve coverity warnings related to uninitialed members in C++ classes
[oweals/cde.git] / cde / programs / dtcreate / parser.c
index 3ba3fbe5b6967545318004c49fb94a661c198b99..13e855fea468695f5cbae60a64e101a79ed48075 100644 (file)
@@ -74,7 +74,7 @@ char keywordDB[][30] = { "ACTION"         ,
                           "WINDOW_TYPE"   ,
                           "ARG_TYPE"      ,
                           "LABEL"         ,
-                          NULL            ,
+                          '\0'            ,
                      };
 
 /* Max Number of fields in Action Keyword Table */
@@ -98,7 +98,7 @@ char FiletypekeywordDB[][30] = { "DATA_ATTRIBUTES"       ,
                                   "MAP_ACTION"           ,
                                   "TYPE"                 ,
                                   "LABEL"                ,
-                                   NULL                  ,
+                                   '\0'                  ,
                      };
 
 /* Max Number of fields in Filetype Keyword Table */
@@ -647,6 +647,7 @@ FiletypeData  **ppFiletypeData,**ppnewFiletypeData;
                 ppFiletypeData[nfiletypes] = 0;
             /* return number of filetypes */
             *nftypes = nfiletypes+1;
+            free(execstr);
             return ppFiletypeData;
 
         }
@@ -707,8 +708,7 @@ GetKeywordValuePairs(char *s, int *id, int table)
         if (!args[1])
         {
            int szArgs1 = strlen(s) + 1;
-            if(s)
-               args[1] = (char *)malloc (szArgs1);
+            args[1] = (char *)malloc (szArgs1);
             if (!args[1])
             {
                 if(args[0])
@@ -881,7 +881,7 @@ int  done=FALSE, argfound=FALSE,promptfound=FALSE;
                            continue;
                       }
                 }
-                else if (s1 && *s1)
+                else if (*s1)
                 {
                      strcat(exec_args[0],s1);
                      if(argbuf)   { free(argbuf); argbuf = NULL; }
@@ -1018,8 +1018,10 @@ char    *s1,*tmp,*s2,buf[10],*cts;
                pFtD->fsFlags|=CA_FT_CNTLONG;
            else if ( !strcmp(buf,"short") )
                pFtD->fsFlags|=CA_FT_CNTSHORT;
-           else
+           else {
+               free(cts);
                return (-1);
+           }
         }
         while( *tmp && isspace(*tmp) )  tmp++;
         s2=tmp;