Private
Public Access
2
0

mraa.c: fclose on NULL fp can segfault on some platforms

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2014-08-01 11:36:10 +02:00
parent 1b2ff8af55
commit 9d488c8e86

View File

@@ -71,10 +71,10 @@ mraa_init()
} else {
platform_type = MRAA_INTEL_GALILEO_GEN1;
}
free(line);
}
fclose(fh);
}
free(line);
fclose(fh);
advance_func = (mraa_adv_func_t*) malloc(sizeof(mraa_adv_func_t));
memset(advance_func, 0, sizeof(mraa_adv_func_t));