Ignore:
Timestamp:
Apr 21, 2016, 7:01:50 PM (8 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
26a6af7
Parents:
ae5d58a
Message:

src/io/*.c: take a copy of const char* path

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/io/sink_sndfile.c

    rae5d58a rb643a33  
    5757  aubio_sink_sndfile_t * s = AUBIO_NEW(aubio_sink_sndfile_t);
    5858  s->max_size = MAX_SIZE;
    59   s->path = path;
    6059
    6160  if (path == NULL) {
     
    6362    return NULL;
    6463  }
     64
     65  if (s->path) AUBIO_FREE(s->path);
     66  s->path = AUBIO_ARRAY(char_t, strnlen(path, PATH_MAX));
     67  strncpy(s->path, path, strnlen(path, PATH_MAX));
    6568
    6669  s->samplerate = 0;
     
    220223void del_aubio_sink_sndfile(aubio_sink_sndfile_t * s){
    221224  if (!s) return;
     225  if (s->path) AUBIO_FREE(s->path);
    222226  aubio_sink_sndfile_close(s);
    223227  AUBIO_FREE(s->scratch_data);
Note: See TracChangeset for help on using the changeset viewer.