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