X-Git-Url: https://git.saurik.com/apt.git/blobdiff_plain/01934fb1fe79cddcc3cb4c79c99c3c30390fdef6..8d3489abd90a64715b92976a7c60b42a386a4c5c:/apt-pkg/versionmatch.cc?ds=sidebyside diff --git a/apt-pkg/versionmatch.cc b/apt-pkg/versionmatch.cc index 65908f733..093180f9b 100644 --- a/apt-pkg/versionmatch.cc +++ b/apt-pkg/versionmatch.cc @@ -183,11 +183,12 @@ bool pkgVersionMatch::ExpressionMatches(const char *pattern, const char *string) char *regex = strdup(pattern + 1); regex[length - 2] = '\0'; if (regcomp(&preg, regex, REG_EXTENDED | REG_ICASE) != 0) { - std::cerr << "E: Invalid regular expression: " << regex << "\n"; + _error->Warning("Invalid regular expression: %s", regex); } else if (regexec(&preg, string, 0, NULL, 0) == 0) { res = true; } free(regex); + regfree(&preg); return res; } }