summaryrefslogtreecommitdiff
path: root/modules.c
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2008-03-29 12:15:17 +0100
committerMichael Biebl <biebl@debian.org>2008-03-29 12:15:17 +0100
commit34a3fe82b4f5bdb372320f59dc6b7260657419a4 (patch)
treee0f6e2f36c355b2b6deab805cf6439548beec942 /modules.c
parent4e5a9c73a92db1016fbc1ce090e35ef3add7e786 (diff)
downloadrsyslog-debian/2.0.3-1.tar.gz
Imported Debian patch 2.0.3-1debian/2.0.3-1
Diffstat (limited to 'modules.c')
-rw-r--r--modules.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/modules.c b/modules.c
index f04c4a9..406cf32 100644
--- a/modules.c
+++ b/modules.c
@@ -378,6 +378,18 @@ rsRetVal modUnloadAndDestructDynamic(void)
}
}
+ /* Note: the last modules pNext pointer is now invalid
+ * (except if the last module was not touched, what is highly
+ * unlikely. We simply fix this be setting it to NULL. After all,
+ * it is the last module ;). This bug had some severe effects in
+ * v3, but none in v2 because in v2 the list was never again
+ * traversed before a new one was added. But even in v2 it may cause
+ * a segfault if the number of loaded modules changed between HUPs.
+ * rgerhards, 2008-02-26
+ */
+ if(pLoadedModulesLast != NULL)
+ pLoadedModulesLast->pNext = NULL;
+
return iRet;
}
/*