diff options
author | Mike Blumenkrantz <zmike@samsung.com> | 2020-03-17 12:05:01 -0400 |
---|---|---|
committer | Marcel Hollerbach <mail@marcel-hollerbach.de> | 2020-03-25 22:13:10 +0100 |
commit | 1af46ef30251c47480f93b2774ab87146021cede (patch) | |
tree | 1feb2012c6cf262612dfd682dcb858567f7992d7 | |
parent | a29d54d1d81a85a0927b4973b1fbfc0c6ed4a162 (diff) | |
download | efl-1af46ef30251c47480f93b2774ab87146021cede.tar.gz |
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 <mail@marcel-hollerbach.de>
Differential Revision: https://phab.enlightenment.org/D11530
-rw-r--r-- | src/lib/ecore_audio/ecore_audio_obj_in_sndfile.c | 4 |
1 files changed, 4 insertions, 0 deletions
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; |