diff --git a/src/at.c b/src/at.c index 358d95a..f5f9200 100644 --- a/src/at.c +++ b/src/at.c @@ -114,14 +114,10 @@ static void next_at_command(struct EG25Manager *manager) if (!at_cmd) return; - if (at_cmd->cmd) - g_free(at_cmd->cmd); - if (at_cmd->subcmd) - g_free(at_cmd->subcmd); - if (at_cmd->value) - g_free(at_cmd->value); - if (at_cmd->expected) - g_free(at_cmd->expected); + g_free(at_cmd->cmd); + g_free(at_cmd->subcmd); + g_free(at_cmd->value); + g_free(at_cmd->expected); g_free(at_cmd); manager->at_cmds = g_list_remove(manager->at_cmds, at_cmd); @@ -152,8 +148,7 @@ static void process_at_result(struct EG25Manager *manager, char *response) return; if (at_cmd->expected && !strstr(response, at_cmd->expected)) { - if (at_cmd->value) - g_free(at_cmd->value); + g_free(at_cmd->value); at_cmd->value = at_cmd->expected; at_cmd->expected = NULL; g_message("Got a different result than expected, changing value...");