Skip to content

Commit 88d4faf

Browse files
committed
更新old_urc_table为new_urc_table
1 parent 57eb1c5 commit 88d4faf

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

components/net/at/src/at_client.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* 2018-04-12 chenyong add client implement
1010
* 2018-08-17 chenyong multiple client support
1111
* 2021-03-17 Meco Man fix a buf of leaking memory
12-
* 2021-05-29 Sszl fix a buf of leaking memory
12+
* 2021-07-14 Sszl fix a buf of leaking memory
1313
*/
1414

1515
#include <at.h>
@@ -562,15 +562,15 @@ int at_obj_set_urc_table(at_client_t client, const struct at_urc *urc_table, rt_
562562
}
563563
else
564564
{
565-
struct at_urc_table *old_urc_table = RT_NULL;
565+
struct at_urc_table *new_urc_table = RT_NULL;
566566

567567
/* realloc urc table space */
568-
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));
569-
if (old_urc_table == RT_NULL)
568+
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));
569+
if (new_urc_table == RT_NULL)
570570
{
571571
return -RT_ENOMEM;
572572
}
573-
573+
client->urc_table = new_urc_table;
574574
client->urc_table[client->urc_table_size].urc = urc_table;
575575
client->urc_table[client->urc_table_size].urc_size = table_sz;
576576
client->urc_table_size++;

0 commit comments

Comments
 (0)