The GError structure is not cleared in an error code path, which
leads to a minor memory leak. Explicitly call g_clear_error().
int remaining = 0;
int numResults;
GRegex *regex = NULL;
- GError *gErr = NULL;
char *pathName;
VMAutomationRequestParser parser;
index, maxResults, (int) offset);
if (pattern) {
+ GError *gErr = NULL;
regex = g_regex_new(pattern, 0, 0, &gErr);
if (!regex) {
g_warning("%s: bad regex pattern '%s' (%s);"
"failing with INVALID_ARG\n",
__FUNCTION__, pattern, gErr ? gErr->message : "");
+ g_clear_error(&gErr);
err = VIX_E_INVALID_ARG;
goto abort;
}