]> granicus.if.org Git - icu/commitdiff
ICU-11991 Fixed memory leak in parse.cpp
authorNebojsa Ciric <cira@chromium.org>
Tue, 12 Feb 2019 19:23:22 +0000 (11:23 -0800)
committerAndy Heninger <andy.heninger@gmail.com>
Tue, 12 Feb 2019 20:53:35 +0000 (12:53 -0800)
Squashed commits for merge.

icu4c/source/tools/genrb/parse.cpp

index 44eb0c082bca05afa84b2f860068b23089494693..884d5d5666081ac476c633e8119e88789ff81180 100644 (file)
@@ -537,7 +537,7 @@ parseDependency(ParseState* state, char *tag, uint32_t startline, const struct U
     uint32_t          line;
     char              filename[256] = { '\0' };
     char              cs[128]       = { '\0' };
-    
+
     expect(state, TOK_STRING, &tokenValue, NULL, &line, status);
 
     if(isVerbose()){
@@ -558,7 +558,7 @@ parseDependency(ParseState* state, char *tag, uint32_t startline, const struct U
             uprv_strcat(filename, U_FILE_SEP_STRING);
         }
     }
-    
+
     u_UCharsToChars(tokenValue->fChars, cs, tokenValue->fLength);
 
     if (U_FAILURE(*status))
@@ -570,7 +570,7 @@ parseDependency(ParseState* state, char *tag, uint32_t startline, const struct U
         if(isStrict()){
             error(line, "The dependency file %s does not exist. Please make sure it exists.\n",filename);
         }else{
-            warning(line, "The dependency file %s does not exist. Please make sure it exists.\n",filename);       
+            warning(line, "The dependency file %s does not exist. Please make sure it exists.\n",filename);
         }
     }
     if(dependencyArray==NULL){
@@ -2000,6 +2000,8 @@ parse(UCHARBUF *buf, const char *inputDir, const char *outputDir, const char *fi
 
     if (state.bundle == NULL || U_FAILURE(*status))
     {
+        delete state.bundle;
+
         return NULL;
     }