Currently, contrib/oid2name doesn't bother to free() the memory that it
authorBruce Momjian <bruce@momjian.us>
Tue, 5 Mar 2002 05:54:07 +0000 (05:54 +0000)
committerBruce Momjian <bruce@momjian.us>
Tue, 5 Mar 2002 05:54:07 +0000 (05:54 +0000)
commit2ffc31390ea7fc481f6f8481189ac689dae6b8a7
treeef9593d03e4355ca5eacdfefabe4b92f707029b7
parent0f8662047e947cfeb62725affd3d764d18a52909
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.

Neil Conway
contrib/oid2name/oid2name.c