s->block_size = block_size;
s->samplerate = samplerate;
- s->path = path;
if ( aubio_source_apple_audio_open ( s, path ) ) {
goto beach;
{
OSStatus err = noErr;
UInt32 propSize;
- s->path = path;
+
+ if (s->path) AUBIO_FREE(s->path);
+ s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX));
+ strncpy(s->path, path, strnlen(path, PATH_MAX));
// open the resource url
- CFURLRef fileURL = createURLFromPath(path);
+ CFURLRef fileURL = createURLFromPath(s->path);
err = ExtAudioFileOpenURL(fileURL, &s->audioFile);
CFRelease(fileURL);
if (err == -43) {
void del_aubio_source_apple_audio(aubio_source_apple_audio_t * s){
aubio_source_apple_audio_close (s);
+ if (s->path) AUBIO_FREE(s->path);
freeAudioBufferList(&s->bufferList);
AUBIO_FREE(s);
return;