Hi Tom,
> Yeah, I noticed that too, and it does offend my inner neatnik.
>
> Instead of what you did, I'd be inclined to add
>
> free(configdir);
>
> return true;
> +
> +fail:
> + free(configdir);
> +
> + return false;
> }
>
> and then s/return false/goto fail/ throughout, so as to avoid
> duplicating the free() calls. It's a minor point as things stand,
> but if more cleanup gets added to the function I think it'd be
> easier to maintain this way.
Makes sense. Here is the corrected patch v2.
> Huh ... don't quite see where in that recipe we'd reach a
> SelectConfigFiles error exit.
How exactly we reach this code patch is a good question. I tried to
understand the exact conditions by using my steps to reproduce and an
ancient debugging technique with sleep(), elog() and `watch` - see
trick.txt. Unfortunately I was not able to reproduce it again nor
under Valgrind nor without it. I guess it means that either I did
something differently before or the right conditions are met under
rare circumstances.