bu5hm4n pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=1af46ef30251c47480f93b2774ab87146021cede

commit 1af46ef30251c47480f93b2774ab87146021cede
Author: Mike Blumenkrantz <[email protected]>
Date:   Tue Mar 17 12:05:01 2020 -0400

    ecore/audio: correctly handle sndfile error when setting new vio
    
    need to immediately call the free here to avoid leaking the callback data
    
    Reviewed-by: Marcel Hollerbach <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D11530
---
 src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c 
b/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c
index 93cf66ff49..dc4bd4578d 100644
--- a/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c
+++ b/src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c
@@ -162,6 +162,10 @@ _ecore_audio_in_sndfile_ecore_audio_vio_set(Eo *eo_obj, 
Ecore_Audio_In_Sndfile_D
   obj->handle = ESF_CALL(sf_open_virtual)(&vio_wrapper, SFM_READ, 
&obj->sfinfo, eo_obj);
 
   if (!obj->handle) {
+    if (ea_obj->vio->free_func)
+      ea_obj->vio->free_func(ea_obj->vio->data);
+    free(ea_obj->vio);
+    ea_obj->vio = NULL;
     eina_stringshare_del(ea_obj->source);
     ea_obj->source = NULL;
     return;

-- 


Reply via email to