projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
294aff6
)
src/io/sink_sndfile.c: avoid a small memory leak when new_sink_sndfile fails
author
Paul Brossier
<piem@piem.org>
Fri, 6 Dec 2013 02:24:57 +0000
(21:24 -0500)
committer
Paul Brossier
<piem@piem.org>
Fri, 6 Dec 2013 02:24:57 +0000
(21:24 -0500)
src/io/sink_sndfile.c
patch
|
blob
|
history
diff --git
a/src/io/sink_sndfile.c
b/src/io/sink_sndfile.c
index
801b929
..
7d2aaea
100644
(file)
--- a/
src/io/sink_sndfile.c
+++ b/
src/io/sink_sndfile.c
@@
-70,6
+70,7
@@
aubio_sink_sndfile_t * new_aubio_sink_sndfile(char_t * path, uint_t samplerate)
if (s->handle == NULL) {
/* show libsndfile err msg */
AUBIO_ERR("Failed opening %s. %s\n", s->path, sf_strerror (NULL));
+ AUBIO_FREE(s);
return NULL;
}
@@
-78,6
+79,7
@@
aubio_sink_sndfile_t * new_aubio_sink_sndfile(char_t * path, uint_t samplerate)
if (s->scratch_size >= MAX_SIZE * MAX_CHANNELS) {
AUBIO_ERR("%d x %d exceeds maximum aubio_sink_sndfile buffer size %d\n",
s->max_size, s->channels, MAX_CHANNELS * MAX_CHANNELS);
+ AUBIO_FREE(s);
return NULL;
}
s->scratch_data = AUBIO_ARRAY(float,s->scratch_size);