[asterisk-dev] [Code Review] A name/value list mechanism for raising events.
rmudgett
reviewboard at asterisk.org
Fri Jan 4 11:58:57 CST 2013
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/2248/#review7611
-----------------------------------------------------------
/trunk/main/nvevent.c
<https://reviewboard.asterisk.org/r/2248/#comment14491>
This assertion is invalid. Code must be able to handle allocation failure.
/trunk/tests/test_nvevent.c
<https://reviewboard.asterisk.org/r/2248/#comment14492>
This is leaked if cmd is TEST_INIT.
This is a good example of why I am not in favor of complex initializations as part of variable declarations in C. People tend to add NULL check parameter validation code after these initializations have already dereferenced the parameters.
/trunk/tests/test_nvevent.c
<https://reviewboard.asterisk.org/r/2248/#comment14493>
Leaked again if cmd is TEST_INIT.
/trunk/tests/test_nvevent.c
<https://reviewboard.asterisk.org/r/2248/#comment14494>
Leaked again.
/trunk/tests/test_nvevent.c
<https://reviewboard.asterisk.org/r/2248/#comment14495>
Memory can be leaked on subsequent parameters in the list if any of these ast_nv_string_field() calls fail. Also you won't know that the SENTINEL came too early because the SENTINEL is NULL.
- rmudgett
On Dec. 20, 2012, 8:36 a.m., Brent Eagles wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/2248/
> -----------------------------------------------------------
>
> (Updated Dec. 20, 2012, 8:36 a.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Summary
> -------
>
> This patch includes an initial crack at a mechanism for creating events through collections of named/value pairs. It also contains some non-heavily-tested code for publishing the name/value pairs as an AMI event.
>
>
> Diffs
> -----
>
> /trunk/include/asterisk/nvevent.h PRE-CREATION
> /trunk/main/nvevent.c PRE-CREATION
> /trunk/tests/test_nvevent.c PRE-CREATION
>
> Diff: https://reviewboard.asterisk.org/r/2248/diff
>
>
> Testing
> -------
>
> Unit test in test_nvevent.c
>
>
> Thanks,
>
> Brent
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20130104/1b3976f5/attachment-0001.htm>
More information about the asterisk-dev
mailing list