Fix dead code
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 4 Dec 2024 15:43:07 +0000 (16:43 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 4 Dec 2024 15:44:40 +0000 (16:44 +0100)
from commit 85b7efa1cdd

per Coverity report

src/backend/utils/adt/like_match.c

index afe5406cf40945d00272790b701409bd4b6a78e9..f19692c3ca15c83ab5410de99832860ced1172c7 100644 (file)
@@ -333,13 +333,14 @@ MatchText(const char *t, int tlen, const char *p, int plen, pg_locale_t locale)
                                 * fails.  Otherwise, try again with a longer substring.
                                 */
                                if (t1len == 0)
+                               {
+                                       if (buf)
+                                               pfree(buf);
                                        return LIKE_FALSE;
+                               }
                                else
                                        NextChar(t1, t1len);
                        }
-                       if (buf)
-                               pfree(buf);
-                       continue;
                }
                else if (GETCHAR(*p, locale) != GETCHAR(*t, locale))
                {