Re: [HACKERS] unchecked malloc

2005-09-28 Thread Tom Lane
Sibtay Abbas <[EMAIL PROTECTED]> writes: > in pl_comp.c, plpgsql_build_variable takes a pointer to a PLpgSQL_type > structure, which is always a malloc'ed instance(since we always use > plpgsql_build_datatype function). As of current sources it's palloc'd, and should be released if the function is

Re: [HACKERS] unchecked malloc

2005-09-27 Thread Sibtay Abbas
This dicussion reminds me of a possible memory leak in plpgsql's code. In case you are interested in it; in pl_comp.c, plpgsql_build_variable takes a pointer to a PLpgSQL_type structure, which is always a malloc'ed instance(since we always use plpgsql_build_datatype function). The switch stateme

Re: [HACKERS] unchecked malloc

2005-09-26 Thread Tom Lane
"Qingqing Zhou" <[EMAIL PROTECTED]> writes: > "Tom Lane" <[EMAIL PROTECTED]> wrote >> No, because you're thinking in terms of the backend environment, and >> generally in the backend the answer to "when to use malloc directly" >> is "never". > Well, except before MemoryContext mechanism is set up?

Re: [HACKERS] unchecked malloc

2005-09-26 Thread Qingqing Zhou
"Tom Lane" <[EMAIL PROTECTED]> wrote > > No, because you're thinking in terms of the backend environment, and > generally in the backend the answer to "when to use malloc directly" > is "never". > Well, except before MemoryContext mechanism is set up? For example, the functions(e.g., GUC, vfd) u

Re: [HACKERS] unchecked malloc

2005-09-26 Thread Tom Lane
"Qingqing Zhou" <[EMAIL PROTECTED]> writes: > There are several places in both backend and tools that forget to check the > return value of malloc(). For example(8.0.1), > backend/port/dynloader/beos.c/pg_dlopen() Dead port, probably not worth fixing. > backend/bootstrap/bootstr

[HACKERS] unchecked malloc

2005-09-26 Thread Qingqing Zhou
There are several places in both backend and tools that forget to check the return value of malloc(). For example(8.0.1), backend/port/dynloader/beos.c/pg_dlopen() backend/bootstrap/bootstrap.c/AddStr() port/strdup.c/strdup() bin/pg_dump/common.c/findParentsByOid() ... I am t