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>
Source *source;
EINA_SAFETY_ON_NULL_RETURN(ctx);
- source = calloc(1, sizeof(Source));
- EINA_SAFETY_ON_NULL_RETURN(source);
-
if (eol < 0)
{
if (pa_context_errno(c) == PA_ERR_NOENTITY)
if (eol > 0)
return;
+ source = calloc(1, sizeof(Source));
+ EINA_SAFETY_ON_NULL_RETURN(source);
+
source->idx = info->index;
source->base.name = eina_stringshare_add(info->name);
source->base.volume = _pa_cvolume_convert(info->volume);