summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/utils.c3
2 files changed, 6 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 7721ccc8d..87d8536a7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
2021-10-30 Oliver Kiddle <opk@zsh.org>
+ * 49533: Src/utils.c: add null check for preprompt functions list
+ that could occur following an error when loading a module
+
* 49528: Src/Zle/comp.h, Src/Zle/compcore.c, Src/Zle/complete.c,
Completion/X/Command/_xinput, Completion/Zsh/Command/_compadd,
Doc/Zsh/compwid.yo: allow multiple -D options to compadd
diff --git a/Src/utils.c b/Src/utils.c
index a74c8bd2c..ed3690172 100644
--- a/Src/utils.c
+++ b/Src/utils.c
@@ -1378,6 +1378,9 @@ delprepromptfn(voidvoidfnptr_t func)
{
LinkNode ln;
+ if (!prepromptfns)
+ return;
+
for (ln = firstnode(prepromptfns); ln; ln = nextnode(ln)) {
Prepromptfn ppdat = (Prepromptfn)getdata(ln);
if (ppdat->func == func) {