diff options
author | waker <wakeroid@gmail.com> | 2011-12-29 12:03:47 +0100 |
---|---|---|
committer | waker <wakeroid@gmail.com> | 2011-12-29 12:03:47 +0100 |
commit | 002eaf676642e3df01b98d2d495c2aff30573553 (patch) | |
tree | 3a9e1fadba1cadffaa21a44c72eadc45e77cf006 /playlist.c | |
parent | 29ca2bdc9970182e1c5bfc7af4d5cf44ee9c3052 (diff) |
fixed filehandle leak in plt_load;
fixed error when loading playlist from URI
Diffstat (limited to 'playlist.c')
-rw-r--r-- | playlist.c | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -2107,15 +2107,10 @@ pl_save_all (void) { playItem_t * plt_load (playlist_t *plt, playItem_t *after, const char *fname, int *pabort, int (*cb)(playItem_t *it, void *data), void *user_data) { - FILE *fp = fopen (fname, "rb"); - if (!fp) { - trace ("plt_load: failed to open %s\n", fname); - return NULL; - } - // try plugins 1st const char *ext = strrchr (fname, '.'); if (ext) { + trace ("finding playlist plugin for %s\n", ext); ext++; DB_playlist_t **plug = plug_get_playlist_list (); int p, e; @@ -2129,6 +2124,12 @@ plt_load (playlist_t *plt, playItem_t *after, const char *fname, int *pabort, in } } trace ("plt_load: loading dbpl\n"); + FILE *fp = fopen (fname, "rb"); + if (!fp) { + trace ("plt_load: failed to open %s\n", fname); + return NULL; + } + uint8_t majorver; uint8_t minorver; |