summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-03-17 12:05:01 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-03-25 22:13:10 +0100
commit1af46ef30251c47480f93b2774ab87146021cede (patch)
tree1feb2012c6cf262612dfd682dcb858567f7992d7
parenta29d54d1d81a85a0927b4973b1fbfc0c6ed4a162 (diff)
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.c4
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
162 obj->handle = ESF_CALL(sf_open_virtual)(&vio_wrapper, SFM_READ, &obj->sfinfo, eo_obj); 162 obj->handle = ESF_CALL(sf_open_virtual)(&vio_wrapper, SFM_READ, &obj->sfinfo, eo_obj);
163 163
164 if (!obj->handle) { 164 if (!obj->handle) {
165 if (ea_obj->vio->free_func)
166 ea_obj->vio->free_func(ea_obj->vio->data);
167 free(ea_obj->vio);
168 ea_obj->vio = NULL;
165 eina_stringshare_del(ea_obj->source); 169 eina_stringshare_del(ea_obj->source);
166 ea_obj->source = NULL; 170 ea_obj->source = NULL;
167 return; 171 return;