forked from enlightenment/enlightenment
mixer: Fix resource leaks
This fixes Coverity CID1308395: Resource leak. Basically, don't bother allocating 'source' if we are just going to end up returning due to 'eol' variable tests Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
2bf57d79af
commit
3a395b4223
|
@ -422,9 +422,6 @@ _source_cb(pa_context *c EINA_UNUSED, const pa_source_info *info,
|
||||||
Source *source;
|
Source *source;
|
||||||
EINA_SAFETY_ON_NULL_RETURN(ctx);
|
EINA_SAFETY_ON_NULL_RETURN(ctx);
|
||||||
|
|
||||||
source = calloc(1, sizeof(Source));
|
|
||||||
EINA_SAFETY_ON_NULL_RETURN(source);
|
|
||||||
|
|
||||||
if (eol < 0)
|
if (eol < 0)
|
||||||
{
|
{
|
||||||
if (pa_context_errno(c) == PA_ERR_NOENTITY)
|
if (pa_context_errno(c) == PA_ERR_NOENTITY)
|
||||||
|
@ -437,6 +434,9 @@ _source_cb(pa_context *c EINA_UNUSED, const pa_source_info *info,
|
||||||
if (eol > 0)
|
if (eol > 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
source = calloc(1, sizeof(Source));
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(source);
|
||||||
|
|
||||||
source->idx = info->index;
|
source->idx = info->index;
|
||||||
source->base.name = eina_stringshare_add(info->name);
|
source->base.name = eina_stringshare_add(info->name);
|
||||||
source->base.volume = _pa_cvolume_convert(info->volume);
|
source->base.volume = _pa_cvolume_convert(info->volume);
|
||||||
|
|
Loading…
Reference in New Issue