From b3a917563c46049c00df4e1729c4402fdaff3909 Mon Sep 17 00:00:00 2001 From: Yeshwanth Reddivari Date: Mon, 23 Nov 2015 21:04:15 +0900 Subject: [PATCH] Eina Example: Fix memory leak of variable buf Summary: Fix memory leak of buf in eina_test_simple_xml_parser.c as reported by static analysis tool, Cppcheck. Reviewers: singh.amitesh, Hermet, jpeg Reviewed By: jpeg Subscribers: alok25, mvsovani, sachin.dev, cedric Differential Revision: https://phab.enlightenment.org/D3371 --- src/tests/eina/eina_test_simple_xml_parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tests/eina/eina_test_simple_xml_parser.c b/src/tests/eina/eina_test_simple_xml_parser.c index 5e55082..ef056f1 100644 --- a/src/tests/eina/eina_test_simple_xml_parser.c +++ b/src/tests/eina/eina_test_simple_xml_parser.c @@ -78,8 +78,8 @@ START_TEST(eina_simple_xml_parser_node_dump) ck_assert_str_eq(out, buf); free(out); eina_simple_xml_node_root_free(root); - free(buf); } + free(buf); } } fclose(f); @@ -251,9 +251,9 @@ START_TEST(eina_simple_xml_parser_parse_with_custom_callback) EINA_TRUE, eina_simple_xml_parser_parse_with_custom_callback_tag_cb, &parse_current_state); - free(buf); fail_if(parse_current_state != simple_xml_parser_current_state_end); } + free(buf); } } -- 2.7.4