Currently, contrib/oid2name doesn't bother to free() the memory that it

Bruce Momjian <bruce@momjian.us>

Commit: 66cd6a0fb2711b9656d5c3872f7a673b70a82818
Author: Bruce Momjian <bruce@momjian.us>
Date: 2002-03-05T05:54:07Z
Releases: 7.3.1
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

Files

PathChange+/−
contrib/oid2name/oid2name.c modified +21 −24