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

Commit

Permalink
Fix response handler
Browse files Browse the repository at this point in the history
Free task data at the very end of task execution.
  • Loading branch information
RoEdAl committed Jun 22, 2024
1 parent 34bb2c0 commit b2bca4e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/at_response.c
Original file line number Diff line number Diff line change
Expand Up @@ -3040,9 +3040,9 @@ struct at_response_taskproc_data* at_response_taskproc_data_alloc(struct pvt* co

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

const at_res_t at_res = at_str2res(&rtd->response);
if (at_res != RES_UNKNOWN) {
ast_str_trim_blanks(&rtd->response);
}
Expand Down
1 change: 1 addition & 0 deletions src/chan_quectel.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,7 @@ int pvt_taskproc_lock_and_execute(struct pvt_taskproc_data* ptd, void (*task_exe
task_exe(ptd);
ast_debug(6, "[%s][%s] Task executed\n", PVT_ID(ptd->pvt), S_OR(task_name, "UNKNOWN"));
AO2_UNLOCK_AND_UNREF(ptd->pvt);
ast_free(ptd);
return 0;
}

Expand Down

0 comments on commit b2bca4e

Please sign in to comment.