aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Michael <cp.michael@samsung.com>2019-05-02 13:46:33 +0200
committerXavi Artigas <xavierartigas@yahoo.es>2019-05-02 13:46:33 +0200
commitdb195e76cdca0f7602b675eeb814facad1afd800 (patch)
treee20b43fcf31e229cf31a585ab23f596740e1819c
parentefl_ui_test_widget: Fix memory leak (diff)
downloadefl-db195e76cdca0f7602b675eeb814facad1afd800.tar.gz
eina_bench_stringshare: Fix resourcce leak
Summary: Coverity reports that we leak the return from eina_counter_dump here, so store the result, print it out, then we can free it. Fixes CID1400975 @fix Depends on https://phab.enlightenment.org/D8767 Reviewers: raster, cedric, zmike, bu5hm4n, segfaultxavi Reviewed By: segfaultxavi Subscribers: segfaultxavi, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8768
-rw-r--r--src/benchmarks/eina/eina_bench_stringshare_e17.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/benchmarks/eina/eina_bench_stringshare_e17.c b/src/benchmarks/eina/eina_bench_stringshare_e17.c
index 2e2769641e..2b2b45cb34 100644
--- a/src/benchmarks/eina/eina_bench_stringshare_e17.c
+++ b/src/benchmarks/eina/eina_bench_stringshare_e17.c
@@ -81,6 +81,7 @@ static void
eina_bench_e17_stringshare(Eina_Stringshare_Test *str)
{
Eina_Counter *cnt;
+ char *result;
cnt = eina_counter_new(str->name);
@@ -96,7 +97,9 @@ eina_bench_e17_stringshare(Eina_Stringshare_Test *str)
eina_counter_stop(cnt, 1);
- fprintf(stderr, "For `%s`:\n%s\n", str->name,eina_counter_dump(cnt));
+ result = eina_counter_dump(cnt);
+ fprintf(stderr, "For `%s`:\n%s\n", str->name, result);
+ free(result);
eina_counter_free(cnt);
}