diff options
author | Alexey Yakovenko <wakeroid@gmail.com> | 2010-10-04 22:49:49 +0200 |
---|---|---|
committer | Alexey Yakovenko <wakeroid@gmail.com> | 2010-10-04 22:49:49 +0200 |
commit | a091698bf50f49c10e5537282b98fb33d22e07dc (patch) | |
tree | 22c697b076e259839dcb4193a072da6c7e6128e8 /plugins | |
parent | 43beeb7291d4c3290bc87f6aa55941dbfcd2d2bd (diff) |
fixed few random memleaks
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/aac/aac.c | 6 | ||||
-rw-r--r-- | plugins/sndfile/sndfile.c | 1 | ||||
-rw-r--r-- | plugins/vorbis/vorbis.c | 2 | ||||
-rw-r--r-- | plugins/wildmidi/src/wildmidi_lib.c | 5 |
4 files changed, 13 insertions, 1 deletions
diff --git a/plugins/aac/aac.c b/plugins/aac/aac.c index 219087b3..2f6b518b 100644 --- a/plugins/aac/aac.c +++ b/plugins/aac/aac.c @@ -899,7 +899,7 @@ int32_t mp4ff_meta_find_by_name(const mp4ff_t *f, const char *item, char **value void aac_load_tags (DB_playItem_t *it, mp4ff_t *mp4) { - char *s; + char *s = NULL; for (int i = 0; metainfo[i]; i += 2) { if (mp4ff_meta_find_by_name(mp4, metainfo[i], &s)) { deadbeef->pl_add_meta (it, metainfo[i+1], s); @@ -912,15 +912,19 @@ aac_load_tags (DB_playItem_t *it, mp4ff_t *mp4) { it->replaygain_album_peak = 1; if (mp4ff_meta_find_by_name(mp4, "replaygain_track_gain", &s)) { it->replaygain_track_gain = atof (s); + free (s); } if (mp4ff_meta_find_by_name(mp4, "replaygain_track_peak", &s)) { it->replaygain_track_peak = atof (s); + free (s); } if (mp4ff_meta_find_by_name(mp4, "replaygain_album_gain", &s)) { it->replaygain_album_gain = atof (s); + free (s); } if (mp4ff_meta_find_by_name(mp4, "replaygain_album_peak", &s)) { it->replaygain_album_peak = atof (s); + free (s); } deadbeef->pl_add_meta (it, "title", NULL); } diff --git a/plugins/sndfile/sndfile.c b/plugins/sndfile/sndfile.c index 90390603..ab1d1ee9 100644 --- a/plugins/sndfile/sndfile.c +++ b/plugins/sndfile/sndfile.c @@ -275,6 +275,7 @@ sndfile_insert (DB_playItem_t *after, const char *fname) { info.ctx = sf_open_virtual (&vfs, SFM_READ, &inf, &info); if (!info.ctx) { trace ("sndfile: sf_open failed"); + deadbeef->fclose (info.file); return NULL; } int totalsamples = inf.frames; diff --git a/plugins/vorbis/vorbis.c b/plugins/vorbis/vorbis.c index db92e223..38c97532 100644 --- a/plugins/vorbis/vorbis.c +++ b/plugins/vorbis/vorbis.c @@ -418,6 +418,7 @@ cvorbis_insert (DB_playItem_t *after, const char *fname) { deadbeef->pl_add_meta (it, "title", NULL); after = deadbeef->pl_insert_item (after, it); deadbeef->pl_item_unref (it); + deadbeef->fclose (fp); return after; } ov_callbacks ovcb = { @@ -431,6 +432,7 @@ cvorbis_insert (DB_playItem_t *after, const char *fname) { int err = ov_open_callbacks (fp, &vorbis_file, NULL, 0, ovcb); if (err != 0) { trace ("ov_open_callbacks returned %d\n", err); + ov_clear (&vorbis_file); return NULL; } diff --git a/plugins/wildmidi/src/wildmidi_lib.c b/plugins/wildmidi/src/wildmidi_lib.c index 5759ffc5..1096ebe6 100644 --- a/plugins/wildmidi/src/wildmidi_lib.c +++ b/plugins/wildmidi/src/wildmidi_lib.c @@ -3845,6 +3845,11 @@ WildMidi_Close (midi * handle) { } if (mdi->index != NULL) free (mdi->index); + + for (i = 0; i < 4; i++) { + free (mdi->filter.delay[i][0]); + free (mdi->filter.delay[i][1]); + } free (mdi); // no need to unlock cause the struct containing the lock no-longer exists; return 0; |