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
This commit is contained in:
Mike Blumenkrantz 2020-03-17 12:05:01 -04:00 committed by Marcel Hollerbach
parent a29d54d1d8
commit 1af46ef302
1 changed files with 4 additions and 0 deletions

View File

@ -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;