[Asterisk-code-review] test_abstract_jb.c: Fix put and put_out_of_order memory leaks. (asterisk[16])
Sean Bright
asteriskteam at digium.com
Thu Sep 9 09:20:12 CDT 2021
Attention is currently required from: Kevin Harwell.
Sean Bright has posted comments on this change. ( https://gerrit.asterisk.org/c/asterisk/+/16419 )
Change subject: test_abstract_jb.c: Fix put and put_out_of_order memory leaks.
......................................................................
Patch Set 3:
(6 comments)
File tests/test_abstract_jb.c:
https://gerrit.asterisk.org/c/asterisk/+/16419/comment/bfcea23c_8350a251
PS2, Line 321: jb->impl->put_first(jb->jbobj, expected_frame, 1100); \
> This will leak expected_frame if AST_JB_IMPL_OK is not returned, so should add a check here.
Ack
https://gerrit.asterisk.org/c/asterisk/+/16419/comment/27b420f0_85ba5eba
PS2, Line 328: ast_test_status_update(test, "Error: On frame %d, got %d back from put (expected %d)\n", \
: i, res, AST_JB_IMPL_OK); \
: return AST_TEST_FAIL; \
> expected_frame needs freeing here as well.
Ack
https://gerrit.asterisk.org/c/asterisk/+/16419/comment/a764465a_70990271
PS2, Line 339: ast_test_status_update(test, "Error: failed to retrieve frame %i at time %ld\n", \
: i, next); \
: return AST_TEST_FAIL; \
> expected_frame needs freeing in this path too.
Ack
https://gerrit.asterisk.org/c/asterisk/+/16419/comment/d39738bd_e79d8036
PS2, Line 457: jb->impl->put_first(jb->jbobj, expected_frame, 1100); \
> Similar to other one, check result and possibly free expected_frame.
Ack
https://gerrit.asterisk.org/c/asterisk/+/16419/comment/5c688ee9_46401321
PS2, Line 470: ast_test_status_update(test, "Error: On frame %d, got %d back from put (expected %d)\n", \
: i, res, AST_JB_IMPL_OK); \
> free expected_frame
Ack
https://gerrit.asterisk.org/c/asterisk/+/16419/comment/9d27a5e3_3a3d53e3
PS2, Line 481: ast_test_status_update(test, "Error: failed to retrieve frame at %ld\n", \
: next); \
: return AST_TEST_FAIL; \
> Free expected_frame here too.
Ack
--
To view, visit https://gerrit.asterisk.org/c/asterisk/+/16419
To unsubscribe, or for help writing mail filters, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: 16
Gerrit-Change-Id: Ib575616101230c4f603519114ec62ebf3936882c
Gerrit-Change-Number: 16419
Gerrit-PatchSet: 3
Gerrit-Owner: Sean Bright <sean at seanbright.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Attention: Kevin Harwell <kharwell at digium.com>
Gerrit-Comment-Date: Thu, 09 Sep 2021 14:20:12 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Kevin Harwell <kharwell at digium.com>
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210909/a369f170/attachment.html>
More information about the asterisk-code-review
mailing list