Private
Public Access
2
0

mraa.c: check lang_func allocated resources correctly

We need to distinguish from an error on mraa_init() and simply not having found
a platform

Signed-off-by: Brendan Le Foll <brendan.le.foll@intel.com>
This commit is contained in:
Brendan Le Foll
2016-03-01 15:50:55 +00:00
parent 237308898c
commit 12b5130c1a

View File

@@ -158,6 +158,9 @@ mraa_init()
}
lang_func = (mraa_lang_func_t*) calloc(1, sizeof(mraa_lang_func_t));
if (lang_func == NULL) {
return MRAA_ERROR_NO_RESOURCES;
}
syslog(LOG_NOTICE, "libmraa initialised for platform '%s' of type %d", mraa_get_platform_name(), mraa_get_platform_type());
return MRAA_SUCCESS;