Hi,

Now, I'm developing some applications with "sqlite-3.0.8",
and also using "electric fence" which is a memory debugger.
(http://www.pf-lug.de/projekte/haya/efence.php)

With the developed applications running, efectric fence detects a
memory error. To be more specific, malloc(0) may be invoked in
"sqlite3_exec()" function.
By default, electric fence detects malloc(0) as a memory error...
(EF_ALLOW_MALLOC_0 is true)


legacy.c (sqlite3_exec)
----------------------------------------------------------------
71:    azCols = sqliteMalloc(2*nCol*sizeof(const char *));
----------------------------------------------------------------

The above code is that (nCol may be 0).

The result of malloc(0) is generally undefined.
(http://www.opengroup.org/onlinepubs/009695399/functions/malloc.html)
Are there any reason to invoke malloc(0) ?

Sincerely,

Mikio Kishi.

Reply via email to