From: Eric Bollengier Date: Mon, 3 May 2010 08:02:58 +0000 (+0200) Subject: Fix segfault when loading Plugins X-Git-Tag: Release-7.0.0~1837 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=2e6218bd293dda83c155150e45b91b14993ec5c0;p=bacula%2Fbacula Fix segfault when loading Plugins --- diff --git a/bacula/src/lib/plugins.c b/bacula/src/lib/plugins.c index a0af158525..7b7d324fe0 100644 --- a/bacula/src/lib/plugins.c +++ b/bacula/src/lib/plugins.c @@ -121,6 +121,8 @@ bool load_plugins(void *binfo, void *bfuncs, const char *plugin_dir, } entry = (struct dirent *)malloc(sizeof(struct dirent) + name_max + 1000); for ( ;; ) { + plugin = NULL; /* Start from a fresh plugin */ + if ((readdir_r(dp, entry, &result) != 0) || (result == NULL)) { if (!found) { Jmsg(NULL, M_WARNING, 0, _("Failed to find any plugins in %s\n"),