OSDN Git Service

android/hal-audio: Fix memory leak
authorAndrei Emeltchenko <andrei.emeltchenko@intel.com>
Fri, 6 Jun 2014 07:19:48 +0000 (10:19 +0300)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 9 Jun 2014 11:52:37 +0000 (14:52 +0300)
Fixes clang warning:
...
android/hal-audio.c:484:3: warning: Potential leak of memory pointed to
by 'preset'
...

android/hal-audio.c

index e9a9c54..1a3d3ae 100644 (file)
@@ -504,7 +504,7 @@ static bool open_endpoint(struct audio_endpoint **epp,
 
        if (!ep) {
                error("Cound not find opened endpoint");
-               return false;
+               goto failed;
        }
 
        *epp = ep;