[OPEN-ILS-DEV] PATCH: oils_dataloader.c (miscellaneous)
Mike Rylander
mrylander at gmail.com
Thu Jan 31 14:30:22 EST 2008
On Jan 12, 2008 8:39 PM, Scott McKellar <mck9 at swbell.net> wrote:
> This patch plugs a minor memory leak and tidies up a few things.
Applied. (more below)
>
> 1. In main() we allocate a growing_buffer named "json". I added a
> line to free it.
>
> 2. In commitTransaction() and rollbackTransaction() I eliminated
> a layer of jsonObjectClone(), along with the associated
> jsonObjectFree(). Now we extract the string we want directly from
> the original object without making an unnecessary copy.
>
> 3. I renamed the four macros starting with "E" so as to start
> with "E_" instead.
>
> 4. All functions (other than main()) are now static, as are the three
> variables that had been declared at global scope.
>
> --------
>
> The memory leak was admittedly minor, since it occurred near the
> end of main().
>
> Identifiers starting with "E" followed by a capital letter are
> reserved for use in <errno.h>.
>
> The macros in question represent values to be returned from main(),
> and three of them are negative. I don't much like the idea of
> returning negative numbers from main() because I don't know what
> happens to them. Traditional UNIX recognizes return values from
> 0 to 255. However I left these negative values alone because there
> may be shell scripts or something that capture them.
>
Right ... I think that Bill uses this to import offline transactions,
but I'm not sure of what it does with the return values. Bill?
> Scott McKellar
> http://home.swbell.net/mck9/ct/
--
Mike Rylander
| VP, Research and Design
| Equinox Software, Inc. / The Evergreen Experts
| phone: 1-877-OPEN-ILS (673-6457)
| email: miker at esilibrary.com
| web: http://www.esilibrary.com
More information about the Open-ils-dev
mailing list