mirror of
https://github.com/eddyem/small_tel.git
synced 2026-05-08 13:57:07 +03:00
fixed memory leak
This commit is contained in:
@@ -48,19 +48,9 @@ static int openserial(const char *path){
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
sl_tty_t *serial = sl_tty_new(str, speed, BUFSIZ);
|
int comfd = sl_tty_fdescr(str, "8N1", speed, 1);
|
||||||
if(!serial || !sl_tty_open(serial, TRUE)){
|
DBG("%s @ %d, comfd=%d", str, speed, comfd);
|
||||||
WARN("Can't open %s @ speed %d", str, speed);
|
|
||||||
FREE(str);
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
DBG("Opened %s @ %d", str, speed);
|
|
||||||
FREE(str);
|
FREE(str);
|
||||||
int comfd = serial->comfd;
|
|
||||||
FREE(serial->portname);
|
|
||||||
FREE(serial->buf);
|
|
||||||
FREE(serial->format);
|
|
||||||
FREE(serial);
|
|
||||||
return comfd;
|
return comfd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user