mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-15 14:28:24 +00:00
test_linkedlists: Fix memory leak
(issue ASTERISK-22467)
Reported by: Corey Farrell
Patches:
test_linkedlists-1.8.patch uploaded by coreyfarrell (license 5909)
test_linkedlists-11up.patch uploaded by coreyfarrell (license 5909)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@401790 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -65,7 +65,6 @@ static int list_expect(struct test_llist *test_list, const char *expect, struct
|
|||||||
#define MATCH_OR_FAIL(list, val, retbuf) \
|
#define MATCH_OR_FAIL(list, val, retbuf) \
|
||||||
if (list_expect(list, val, &retbuf)) { \
|
if (list_expect(list, val, &retbuf)) { \
|
||||||
ast_test_status_update(test, "Expected: %s, Got: %s\n", val, ast_str_buffer(retbuf)); \
|
ast_test_status_update(test, "Expected: %s, Got: %s\n", val, ast_str_buffer(retbuf)); \
|
||||||
ast_free(retbuf); \
|
|
||||||
return AST_TEST_FAIL; \
|
return AST_TEST_FAIL; \
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -77,7 +76,7 @@ static int list_expect(struct test_llist *test_list, const char *expect, struct
|
|||||||
|
|
||||||
AST_TEST_DEFINE(single_ll_tests)
|
AST_TEST_DEFINE(single_ll_tests)
|
||||||
{
|
{
|
||||||
struct ast_str *buf;
|
RAII_VAR(struct ast_str *, buf, NULL, ast_free);
|
||||||
struct test_llist test_list = { 0, };
|
struct test_llist test_list = { 0, };
|
||||||
struct test_llist other_list = { 0, };
|
struct test_llist other_list = { 0, };
|
||||||
struct test_val *bogus;
|
struct test_val *bogus;
|
||||||
|
|||||||
Reference in New Issue
Block a user