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

Closed
wants to merge 1 commit into
from
Jump to file or symbol
Failed to load files and symbols.
+3 −1
Split
View
@@ -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;