summaryrefslogtreecommitdiff
path: root/components/net/at/src
diff options
context:
space:
mode:
authorsszl <[email protected]>2021-07-14 09:22:34 +0800
committersszl <[email protected]>2021-07-14 11:01:21 +0800
commit88d4faf68735948d6310e2d2271d576c5de254a0 (patch)
tree6220734d5568dccb90894f7c167ff1a7ac3ad1a7 /components/net/at/src
parent57eb1c5a805fc6d545b26f0d076fe9ff08802144 (diff)
更新old_urc_table为new_urc_table
Diffstat (limited to 'components/net/at/src')
-rw-r--r--components/net/at/src/at_client.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/components/net/at/src/at_client.c b/components/net/at/src/at_client.c
index 37892eee2c..f40d7698a7 100644
--- a/components/net/at/src/at_client.c
+++ b/components/net/at/src/at_client.c
@@ -9,7 +9,7 @@
* 2018-04-12 chenyong add client implement
* 2018-08-17 chenyong multiple client support
* 2021-03-17 Meco Man fix a buf of leaking memory
- * 2021-05-29 Sszl fix a buf of leaking memory
+ * 2021-07-14 Sszl fix a buf of leaking memory
*/
#include <at.h>
@@ -562,15 +562,15 @@ int at_obj_set_urc_table(at_client_t client, const struct at_urc *urc_table, rt_
}
else
{
- struct at_urc_table *old_urc_table = RT_NULL;
+ struct at_urc_table *new_urc_table = RT_NULL;
/* realloc urc table space */
- old_urc_table = (struct at_urc_table *) rt_realloc(client->urc_table,client->urc_table_size * sizeof(struct at_urc_table) + sizeof(struct at_urc_table));
- if (old_urc_table == RT_NULL)
+ new_urc_table = (struct at_urc_table *) rt_realloc(client->urc_table,client->urc_table_size * sizeof(struct at_urc_table) + sizeof(struct at_urc_table));
+ if (new_urc_table == RT_NULL)
{
return -RT_ENOMEM;
}
-
+ client->urc_table = new_urc_table;
client->urc_table[client->urc_table_size].urc = urc_table;
client->urc_table[client->urc_table_size].urc_size = table_sz;
client->urc_table_size++;