diff --git a/src/libs/tools/src/plugindatabase.cpp b/src/libs/tools/src/plugindatabase.cpp index 091de158405..6cea5de6ca5 100644 --- a/src/libs/tools/src/plugindatabase.cpp +++ b/src/libs/tools/src/plugindatabase.cpp @@ -57,6 +57,7 @@ std::vector ModulesPluginDatabase::listAllPlugins () const glob_t pglob; if (glob (BUILTIN_PLUGIN_FOLDER "/libelektra-*", GLOB_NOSORT, NULL, &pglob) == 0) { + ELEKTRA_LOG ("has glob %zd", pglob.gl_pathc); for (size_t i = 0; i < pglob.gl_pathc; ++i) { std::string fn (pglob.gl_pathv[i]); @@ -69,8 +70,8 @@ std::vector ModulesPluginDatabase::listAllPlugins () const if (toIgnore.find (name) != toIgnore.end ()) continue; // ignore ret.push_back (name); } + globfree (&pglob); } - globfree (&pglob); #endif if (!ret.empty ()) { diff --git a/src/plugins/augeas/augeas.c b/src/plugins/augeas/augeas.c index 2184703ed4f..9cfbf0cc90e 100644 --- a/src/plugins/augeas/augeas.c +++ b/src/plugins/augeas/augeas.c @@ -75,10 +75,11 @@ static const char * getLensPath (Plugin * handle) int elektraAugeasGenConf (KeySet * ks, Key * errorKey ELEKTRA_UNUSED) { glob_t pglob; + int retval = 1; const char * f = "/usr/share/augeas/lenses/dist/*.aug"; if (glob (f, GLOB_NOSORT, NULL, &pglob) == 0) { - printf ("has glob %zd\n", pglob.gl_pathc); + ELEKTRA_LOG ("has glob %zd", pglob.gl_pathc); for (size_t i = 0; i < pglob.gl_pathc; ++i) { char * p = elektraStrDup (basename (pglob.gl_pathv[i])); @@ -99,16 +100,17 @@ int elektraAugeasGenConf (KeySet * ks, Key * errorKey ELEKTRA_UNUSED) p[l - 4] = '.'; keySetString (k, p); ksAppendKey (ks, k); - printf ("%s\n", p); } + elektraFree (p); } globfree (&pglob); } else { ELEKTRA_SET_ERRORF (142, errorKey, "Could not glob %s", f); + retval = -1; } - return 1; + return retval; } static const char * getAugeasError (augeas * augeasHandle)