From 9e05bdd807f2f0da34fe88dd5eb7030a9b571c56 Mon Sep 17 00:00:00 2001 From: Edward Emelianov Date: Thu, 7 May 2026 14:44:17 +0300 Subject: [PATCH] fixed memory leak --- Daemons/weatherdaemon_multimeteo/fd.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/Daemons/weatherdaemon_multimeteo/fd.c b/Daemons/weatherdaemon_multimeteo/fd.c index 11c1a77..36c42f7 100644 --- a/Daemons/weatherdaemon_multimeteo/fd.c +++ b/Daemons/weatherdaemon_multimeteo/fd.c @@ -48,19 +48,9 @@ static int openserial(const char *path){ return -1; } } - sl_tty_t *serial = sl_tty_new(str, speed, BUFSIZ); - if(!serial || !sl_tty_open(serial, TRUE)){ - WARN("Can't open %s @ speed %d", str, speed); - FREE(str); - return -1; - } - DBG("Opened %s @ %d", str, speed); + int comfd = sl_tty_fdescr(str, "8N1", speed, 1); + DBG("%s @ %d, comfd=%d", str, speed, comfd); FREE(str); - int comfd = serial->comfd; - FREE(serial->portname); - FREE(serial->buf); - FREE(serial->format); - FREE(serial); return comfd; }