- rested current dialog pointer when distroying dialog to avoid double free done from post script callback - reported by Klaus Feichtinger
@@ -153,6 +153,9 @@ inline void destroy_dlg(struct dlg_cell *dlg)
run_dlg_callbacks( DLGCB_DESTROY , dlg, 0, DLG_DIR_NONE, 0);
+ if(dlg==get_current_dlg_pointer())
+ reset_current_dlg_pointer();
+
if (dlg->cbs.first)
destroy_dlg_callbacks_list(dlg->cbs.first);
@@ -172,6 +175,7 @@ inline void destroy_dlg(struct dlg_cell *dlg)
shm_free(dlg->cseq[DLG_CALLEE_LEG].s);
shm_free(dlg);
+ dlg = 0;
}
@@ -69,6 +69,16 @@ static struct dlg_profile_table* new_dlg_profile( str *name,
unsigned int size, unsigned int has_value);
+struct dlg_cell *get_current_dlg_pointer(void)
+{
+ return current_dlg_pointer;
+}
+void reset_current_dlg_pointer(void)
+ current_dlg_pointer = NULL;
/*!
* \brief Add profile definitions to the global list
* \see new_dlg_profile
@@ -79,6 +79,10 @@ struct dlg_profile_table {
};
+struct dlg_cell *get_current_dlg_pointer(void);
+void reset_current_dlg_pointer(void);