summaryrefslogtreecommitdiff
path: root/src/benchmarks
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 /src/benchmarks
parente96d29665973c3fa8809d5e2551e9b7ae97d2d33 (diff)
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 D8767 Reviewers: raster, cedric, zmike, bu5hm4n, segfaultxavi Reviewed By: segfaultxavi Subscribers: segfaultxavi, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8768
Diffstat (limited to 'src/benchmarks')
-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 2e27696..2b2b45c 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
81eina_bench_e17_stringshare(Eina_Stringshare_Test *str) 81eina_bench_e17_stringshare(Eina_Stringshare_Test *str)
82{ 82{
83 Eina_Counter *cnt; 83 Eina_Counter *cnt;
84 char *result;
84 85
85 cnt = eina_counter_new(str->name); 86 cnt = eina_counter_new(str->name);
86 87
@@ -96,7 +97,9 @@ eina_bench_e17_stringshare(Eina_Stringshare_Test *str)
96 97
97 eina_counter_stop(cnt, 1); 98 eina_counter_stop(cnt, 1);
98 99
99 fprintf(stderr, "For `%s`:\n%s\n", str->name,eina_counter_dump(cnt)); 100 result = eina_counter_dump(cnt);
101 fprintf(stderr, "For `%s`:\n%s\n", str->name, result);
102 free(result);
100 103
101 eina_counter_free(cnt); 104 eina_counter_free(cnt);
102} 105}