src: be more careful when freeing data

This commit is contained in:
Arnaud Ferraris
2020-12-10 21:31:22 +01:00
parent a8a1c8d161
commit fa21de07f4
4 changed files with 35 additions and 11 deletions

View File

@@ -206,7 +206,8 @@ int at_init(struct EG25Manager *manager)
void at_destroy(struct EG25Manager *manager)
{
g_source_remove(manager->at_source);
close(manager->at_fd);
if (manager->at_fd > 0)
close(manager->at_fd);
}
void at_sequence_configure(struct EG25Manager *manager)