On success, cli_parse_add_crtlist() leaks the strings of a ckch_conf in
two cases: when the store takes the conf parsed from the line, its
previous conf is overwritten without being freed, and when the store
already has instances, the parsed conf is only compared to the one of
the store and never freed.
Let's free the conf which is not used by the store. This was introduced
by commit
1bc6e990f ("MEDIUM: ssl/cli: handle crt-store keywords in
crt-list over the CLI") in 3.0-dev12, so this should be backported to
3.0, after commit
29225103f ("BUG/MEDIUM: ssl/cli: restore the store
conf on "add ssl crt-list" error").
ctx->crtlist = crtlist;
ctx->entry = entry;
+ /* the store uses only one of them */
+ ckch_conf_clean(adopted ? &old_cc : &cc);
+
/* unlock is done in the release handler */
return 0;