oid2name cleanup - Mailing list pgsql-patches

From Neil Conway
Subject oid2name cleanup
Date
Msg-id 1014585778.7686.83.camel@jiro
Whole thread Raw
Responses Re: oid2name cleanup
Re: oid2name cleanup
List pgsql-patches
Currently, contrib/oid2name doesn't bother to free() the memory that it
malloc()'s. This isn't too serious (because oid2name is a short-lived
utility, so the memory will soon be returned to the OS on process
termination), but I still think it's poor style.

This patch changes oid2name so that it allocates memory on the stack
where possible and free()s the remaining heap-allocated memory. The
patch also fixes a typo a comment and adds 'const' qualifiers to a few
'char *' function parameters.

Cheers,

Neil

--
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC

Attachment

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: ALTER TABLE OWNER: change indexes
Next
From: Tom Lane
Date:
Subject: Re: ALTER TABLE OWNER: change indexes