I don't think you understand how Postgres memory management works.
Maybe not yet. Valgrind may also don't understand yet.
There's no permanent leak here, just till the end of the command; so it's pretty doubtful that there's any need to expend cycles on an explicit pfree.
Maybe.
==30691== 24 bytes in 1 blocks are definitely lost in loss record 123 of 469 ==30691== at 0x8991F0: MemoryContextAlloc (mcxt.c:893) ==30691== by 0x899F29: MemoryContextStrdup (mcxt.c:1291) ==30691== by 0x864E09: RelationInitIndexAccessInfo (relcache.c:1419) ==30691== by 0x865F81: RelationBuildDesc (relcache.c:1175) ==30691== by 0x868575: load_critical_index (relcache.c:4168) ==30691== by 0x8684A0: RelationCacheInitializePhase3 (relcache.c:3980) ==30691== by 0x88047A: InitPostgres (postinit.c:1031) ==30691== by 0x773F12: PostgresMain (postgres.c:4081) ==30691== by 0x6F9C33: BackendRun (postmaster.c:4506) ==30691== by 0x6F96D8: BackendStartup (postmaster.c:4228) ==30691== by 0x6F8C08: ServerLoop (postmaster.c:1745) ==30691== by 0x6F747B: PostmasterMain (postmaster.c:1417)