Skip site navigation (1) Skip section navigation (2)

oid2name cleanup

From: Neil Conway <nconway(at)klamath(dot)dyndns(dot)org>
To: pgsql-patches(at)postgresql(dot)org
Subject: oid2name cleanup
Date: 2002-02-24 21:22:58
Message-ID: 1014585778.7686.83.camel@jiro (view raw or flat)
Thread:
Lists: 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(at)rogers(dot)com>
PGP Key ID: DB3C29FC

Attachment: oid2name_cleanup.patch
Description: text/x-patch (5.2 KB)

Responses

pgsql-patches by date

Next:From: Tom LaneDate: 2002-02-24 21:35:49
Subject: Re: ALTER TABLE OWNER: change indexes
Previous:From: Neil ConwayDate: 2002-02-24 21:13:30
Subject: ALTER TABLE OWNER: change indexes

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group