From 88387704e1128b9e862f022c1c2267d1121d29dd Mon Sep 17 00:00:00 2001 From: Drath Date: Fri, 3 Jul 2026 00:45:37 +0200 Subject: [PATCH] possible bug, also consistency --- src/main.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main.c b/src/main.c index 0e92539..68326b6 100644 --- a/src/main.c +++ b/src/main.c @@ -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;