[Asterisk-code-review] test_abstract_jb.c: Fix put and put_out_of_order memory leaks. (asterisk[16])
Kevin Harwell
asteriskteam at digium.com
Wed Sep 8 18:16:39 CDT 2021
Attention is currently required from: Sean Bright.
Kevin Harwell 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 2: Code-Review-1
(6 comments)
File tests/test_abstract_jb.c:
https://gerrit.asterisk.org/c/asterisk/+/16419/comment/a000fec0_b14d318b
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.
https://gerrit.asterisk.org/c/asterisk/+/16419/comment/b21f5525_78361301
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.
https://gerrit.asterisk.org/c/asterisk/+/16419/comment/ae966ee4_85e8a4d5
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.
https://gerrit.asterisk.org/c/asterisk/+/16419/comment/a60dc3ee_81113df8
PS2, Line 457: jb->impl->put_first(jb->jbobj, expected_frame, 1100); \
Similar to other one, check result and possibly free expected_frame.
https://gerrit.asterisk.org/c/asterisk/+/16419/comment/79012011_b4d7977c
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
https://gerrit.asterisk.org/c/asterisk/+/16419/comment/041f8c6a_6e302a8e
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.
--
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: 2
Gerrit-Owner: Sean Bright <sean at seanbright.com>
Gerrit-Reviewer: Friendly Automation
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Attention: Sean Bright <sean at seanbright.com>
Gerrit-Comment-Date: Wed, 08 Sep 2021 23:16:39 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20210908/fe6355d9/attachment-0001.html>
More information about the asterisk-code-review
mailing list