Coverity: String module Resource Leaks fixed
[scilab.git] / scilab / modules / string / src / c / pcre_private.c
index e5dc3c9..9aa7d99 100644 (file)
@@ -242,6 +242,7 @@ pcre_error_code pcre_private(char *INPUT_LINE, char *INPUT_PAT, int *Output_Star
         }
         if (*p == 0)
         {
+            FREE(back_p);
             continue;
         }
         /* In-line pattern (the usual case). Get the delimiter and seek the end of
@@ -400,6 +401,11 @@ pcre_error_code pcre_private(char *INPUT_LINE, char *INPUT_PAT, int *Output_Star
                             FREE(buffer);
                             buffer = NULL;
                         }
+                        if (back_p)
+                        {
+                            FREE(back_p);
+                            back_p = NULL;
+                        }
                         if (offsets)
                         {
                             FREE(offsets);