The function responsible for freeing a recurring appointment or event
did not free the linked lists contained in the `struct rpt` holding the
recurrence rules. This led to memory leaks if a user had recurring
appointments or events.
Found with ASAN.
Signed-off-by: Max Kunzelmann <max@mxzero.net>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
Previous to this commit, a strdup took place for every key name
including those that were replaced with customized key names later on
while never calling free on the pointer returned by strdup.
This fix only calls strdup for key names that are not replaced with
custom key names.
Found with ASAN.
Signed-off-by: Max Kunzelmann <max@mxzero.net>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
If fgets reads a line that only contains a `\n`, then the pointer `eol`
will point to the first byte in that buffer. The subsequent dereference
of `*(eol -1 )` will access the byte before that buffer.
This fix makes sure that that length of the current line read by fgets
is at least 2 bytes long.
Signed-off-by: Max Kunzelmann <max@mxzero.net>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
The man page stdarg(3) states that each invocation of `va_copy()` must
be matched by a corresponding invocation of `va_end()` in the same
function.
Signed-off-by: Max <max@mxzero.net>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
When the function is called, `col` is zero, which leads to setting the
sidebar width (in percent) to zero. As the variable holding the
percentage is `static unsigned sbarwidth_perc` it is initialized to zero
anyway and we set the percentage later to the value loaded from the
configuration, too.
Signed-off-by: Max <max@mxzero.net>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
For example, using `pass caldav` as `PasswordCommand` returns the
password for the account including a newline character at the end
because the whole output is captured. This fix removes the new line
character at the end of the line while keeping other whitespace
character should the password contain any at the end.
Signed-off-by: Max <max@mxzero.net>
Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>