[OPEN-ILS-DEV] PATCH: transport_session.[ch] (miscellaneous)
Scott McKellar
mck9 at swbell.net
Sun Nov 4 00:02:13 EDT 2007
These patches tidy up a few things:
1. I turned get_xml_attr() into a static function. No other file
references it. Also I added a const qualifier to the second
parameter.
2. In several cases the result of the sizeof operator was assigned
to an intermediate variable, which was then passed to safe_malloc().
Since these variables weren't used for anything else, I eliminated
them to avoid clutter.
3. I explicitly assigned zero or NULL to various members of newly
allocated structs, to avoid relying on the memset() in safe_malloc().
4. In init_transport(), the code executes an early exit if it fails
to create any of a series of growing_buffers. I plugged a memory
leak by freeing previously allocate memory in this circumstance.
This problem is unlikely ever to happen, but if we handle it at all,
we might as well handle it correctly.
5. In several cases we were casting a const xmlChar* to a char*,
stripping away the constness. These cases were actually benign, but
it's just not nice to cast away constness if you don't have to. So
I added constness to the cast.
Scott McKellar
http://home.swbell.net/mck9/ct/
Developer's Certificate of Origin 1.1 By making a contribution to
this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license indicated
in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source license
and I have the right under that license to submit that work with
modifications, whether created in whole or in part by me, under the
same open source license (unless I am permitted to submit under a
different license), as indicated in the file; or
(c) The contribution was provided directly to me by some other person
who certified (a), (b) or (c) and I have not modified it; and
(d) In the case of each of (a), (b), or (c), I understand and agree
that this project and the contribution are public and that a record
of the contribution (including all personal information I submit
with it, including my sign-off) is maintained indefinitely and may
be redistributed consistent with this project or the open source
license indicated in the file.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: transport_session_h_1.patch
Type: text/x-patch
Size: 967 bytes
Desc: 478670817-transport_session_h_1.patch
Url : http://list.georgialibraries.org/pipermail/open-ils-dev/attachments/20071103/ba31d8fc/transport_session_h_1-0001.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: transport_session_c_1.patch
Type: text/x-patch
Size: 7316 bytes
Desc: 3591682290-transport_session_c_1.patch
Url : http://list.georgialibraries.org/pipermail/open-ils-dev/attachments/20071103/ba31d8fc/transport_session_c_1-0001.bin
More information about the Open-ils-dev
mailing list