ig we still free it?
This commit is contained in:
@@ -183,6 +183,7 @@ int main(void) {
|
||||
struct sensors_t *sensors = malloc(sizeof(*sensors)); // no actual point in mallocing and it is ever so sligtly slower to access heap vs stack, but its cool
|
||||
if (sensors == nullptr) {
|
||||
applog(LOG_ERR, "can't allocate mem for the sensor struct. You don't got %lu bytes bro?", sizeof(*sensors));
|
||||
free(sensors);
|
||||
return 1;
|
||||
}
|
||||
applog(LOG_INF, "sensor struct allocated, size is %lu bytes", sizeof(*sensors));
|
||||
|
||||
Reference in New Issue
Block a user