[PATCH] Silence Valgrind about SelectConfigFiles()

Aleksander Alekseev <aleksander@tigerdata.com>

From: Aleksander Alekseev <aleksander@tigerdata.com>
To: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-08-13T23:04:18Z
Lists: pgsql-hackers

Attachments

Hi,

I experimented with Valgrind after recent changes committed by Tom [1]
and catched this:

```
25 bytes in 1 blocks are definitely lost in loss record 18 of 49
   at 0x4846828: malloc (in
/usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
   by 0x57DE35E: strdup (strdup.c:42)
   by 0x9D9D1D: make_absolute_path (path.c:877)
   by 0x98AD5D: SelectConfigFiles (guc.c:1795)
   by 0x65F104: PostmasterMain (postmaster.c:785)
   by 0x52F2B9: main (main.c:231)
```

I propose to correct this as attached.

[1]: https://postgr.es/m/285483.1746756246@sss.pgh.pa.us

Commits

  1. Don't leak memory during failure exit from SelectConfigFiles().