[reSIProcate] misc safety and leak fixes: ares, rutil, stack

Kennard White kennard_white at logitech.com
Wed Dec 22 16:14:02 CST 2010


Hi,

A static code analysis tool revealed a number of issues in ares, rutil and
stack. Included are proposed patches with my fixes. These fixes include:
  * memory leaks (in error cases), where fix now properly frees memory
  * double frees, where callee free'd message and then caller also free's it
  * new asserts, to make it clear that there is unhandled error case
  * missing return code checking, where that code indicates if dynamic
memory allocation took place
  * missing case breaks and missing FALLTHRU comments indicating missing
break is expected
  * comments, for cases where I don't know how to fix it (constructors that
don't initialize all member variables are an example)
  * Fixes where system call return value was being used instead of errno.
  * Restructuring of StatisticManager's AtomicPayload from stack variable
into member variable, both to reduce stack utilization and allow
StatisticsMessage to be queued without getting stack corruption.


All code compiles and checks pass.

I plan to commit to trunk this week -- please let me know if you see any
issues. Any corrections are greatly appreciated. I'm just trying to make the
analysis tool happy, I'm not wedded to any particular fix.

 I'm working on similar fixes for dum, but that might not be ready until
after the holidays.

Thanks,
Kennard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20101222/5e8d6b2d/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cov-ares1.patch
Type: application/octet-stream
Size: 4366 bytes
Desc: not available
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20101222/5e8d6b2d/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cov-stack1.patch
Type: application/octet-stream
Size: 7814 bytes
Desc: not available
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20101222/5e8d6b2d/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cov-rutil2.patch
Type: application/octet-stream
Size: 4091 bytes
Desc: not available
URL: <http://list.resiprocate.org/pipermail/resiprocate-devel/attachments/20101222/5e8d6b2d/attachment-0002.obj>


More information about the resiprocate-devel mailing list