Fix crash (segfault) in etags on generating tags for Erlang files

* lib-src/etags.c: Set allocated and lastlen to zero, after
freeing last ptr in Erlang_functions to prevent dereferencing NULL
pointer (bug#45122).

Copyright-paperwork-exempt: yes

(cherry picked from commit 2d8f0364fc)
This commit is contained in:
Serge Tupchii 2020-12-08 21:22:34 +01:00 committed by Eli Zaretskii
parent c0b3e38d7c
commit 809b22d18d

View file

@ -6062,6 +6062,7 @@ Erlang_functions (FILE *inf)
{
free (last);
last = NULL;
allocated = lastlen = 0;
}
}
else