From: Eric Bollengier Date: Mon, 3 May 2010 08:02:58 +0000 (+0200) Subject: Fix segfault when loading Plugins X-Git-Tag: Release-5.0.3~180 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=e55c99331501f60308ffc27a7226187ea0dbee08;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"),