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
This commit is contained in:
Christopher Michael 2019-05-02 13:46:33 +02:00 committed by Xavi Artigas
parent e96d296659
commit db195e76cd
1 changed files with 4 additions and 1 deletions

View File

@ -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);
}