Browse files

Settings: Close file pointer after the call to fb_size(fp)

  • Loading branch information...
1 parent 4462813 commit 629611b760ce8ac064c439442290d378d93dcaa6 @mikrohard committed Nov 29, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 src/settings.c
View
4 src/settings.c
@@ -195,11 +195,13 @@ hts_settings_load_one(const char *filename)
mem = malloc(fb_size(fp)+1);
n = fb_read(fp, mem, fb_size(fp));
if (n >= 0) mem[n] = 0;
- fb_close(fp);
/* Decode */
if(n == fb_size(fp))
r = htsmsg_json_deserialize(mem);
+
+ /* Close */
+ fb_close(fp);
free(mem);
return r;

0 comments on commit 629611b

Please sign in to comment.