Plug some memory leaks, and eliminate some unnecessary
memory allocations.
In oils_utils.[ch]:
-- Create a new function, oilsFMGetStringConst(), similar to
oilsFMGetString() except that it doesn't allocate memory; it returns
a const pointer to a string internal to the specified object.
-- Add some comments, tidy up white space.
In oils_sql.c:
-- Replace oilsFMGetString() with oilsFMGetStringConst in a number
of places; partly to reduce memory churn, and partly to plug some
memory leaks where the function call was nested within a
parameter list.
-- Change org_tree_root() so as to return a const pointer to a
static buffer (which was already in use as a cache) instead of
allocating a copy of the string. This change reduces memory
churn. In addition the allocated string was leaking anyway, and
now that leak is plugged.
M Open-ILS/include/openils/oils_utils.h
M Open-ILS/src/c-apps/oils_sql.c
M Open-ILS/src/c-apps/oils_utils.c
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16494
dcc99617-32d9-48b4-a31d-
7c20da2025e4