coap-server.c: add missing fclose in read_file_mem

This fixes CID 1495722.
This commit is contained in:
Olaf Bergmann committed 2020-06-19 16:01:29 +02:00
1 parent e413fd545b
commit ba45a57efc
1 file changed
+3 -1
+3 -1
View File
@@ -749,8 +749,10 @@ static uint8_t *read_file_mem(const char* file, size_t *length) {
}
buf = malloc(statbuf.st_size+1);
if (!buf)
if (!buf) {
fclose(f);
return NULL;
}
if (fread(buf, 1, statbuf.st_size, f) != (size_t)statbuf.st_size) {
fclose(f);