possible bug, also consistency

This commit is contained in:
2026-07-03 00:45:37 +02:00
parent 6920f9f34f
commit 88387704e1

View File

@@ -182,11 +182,10 @@ int main(void) {
/* malloc memory for the struct */
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 == NULL) {
applog(LOG_ERR, "can't allocate mem for the sensor struct. You don't got %lu bytes bro?", sizeof(struct sensors_t));
free(sensors);
applog(LOG_ERR, "can't allocate mem for the sensor struct. You don't got %lu bytes bro?", sizeof(*sensors));
return 1;
}
applog(LOG_INF, "sensor struct allocated, size is %lu bytes", sizeof(struct sensors_t));
applog(LOG_INF, "sensor struct allocated, size is %lu bytes", sizeof(*sensors));
/* signal setup */
sigset_t sigset;