fix double free in fluid_sample_set_sound_data()

This commit is contained in:
derselbst 2018-12-29 18:21:43 +01:00
parent 15d27b7145
commit b7b420617b

View file

@ -572,9 +572,10 @@ fluid_sample_set_sound_data(fluid_sample_t *sample,
{
FLUID_FREE(sample->data);
FLUID_FREE(sample->data24);
sample->data = NULL;
sample->data24 = NULL;
}
sample->data = NULL;
sample->data24 = NULL;
if(copy_data)
{
@ -637,6 +638,8 @@ error_rec:
FLUID_LOG(FLUID_ERR, "Out of memory");
FLUID_FREE(sample->data);
FLUID_FREE(sample->data24);
sample->data = NULL;
sample->data24 = NULL;
return FLUID_FAILED;
#undef SAMPLE_LOOP_MARGIN