Skip to content
This repository was archived by the owner on Sep 13, 2024. It is now read-only.

Commit b2bca4e

Browse files
committed
Fix response handler
Free task data at the very end of task execution.
1 parent 34bb2c0 commit b2bca4e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/at_response.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3040,9 +3040,9 @@ struct at_response_taskproc_data* at_response_taskproc_data_alloc(struct pvt* co
30403040

30413041
static void response_taskproc(struct pvt_taskproc_data* ptd)
30423042
{
3043-
RAII_VAR(struct at_response_taskproc_data* const, rtd, (struct at_response_taskproc_data*)ptd, ast_free);
3043+
struct at_response_taskproc_data* const rtd = (struct at_response_taskproc_data*)ptd;
3044+
const at_res_t at_res = at_str2res(&rtd->response);
30443045

3045-
const at_res_t at_res = at_str2res(&rtd->response);
30463046
if (at_res != RES_UNKNOWN) {
30473047
ast_str_trim_blanks(&rtd->response);
30483048
}

src/chan_quectel.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,7 @@ int pvt_taskproc_lock_and_execute(struct pvt_taskproc_data* ptd, void (*task_exe
684684
task_exe(ptd);
685685
ast_debug(6, "[%s][%s] Task executed\n", PVT_ID(ptd->pvt), S_OR(task_name, "UNKNOWN"));
686686
AO2_UNLOCK_AND_UNREF(ptd->pvt);
687+
ast_free(ptd);
687688
return 0;
688689
}
689690

0 commit comments

Comments
 (0)