crash and unexpected behaviours fix

This commit is contained in:
Domingo Dirutigliano
2025-03-03 23:55:24 +01:00
parent 832c6e1530
commit fde3ee57a5
7 changed files with 47 additions and 67 deletions

View File

@@ -73,7 +73,6 @@ struct pyfilter_ctx {
}
~pyfilter_ctx(){
cerr << "[info] [pyfilter_ctx] Cleaning pyfilter_ctx" << endl;
Py_DECREF(glob);
Py_DECREF(py_handle_packet);
PyGC_Collect();
@@ -120,14 +119,8 @@ struct pyfilter_ctx {
// Set packet info to the global context
set_item_to_glob("__firegex_packet_info", packet_info);
#ifdef DEBUG
cerr << "[DEBUG] [handle_packet] Calling python with a data of " << data.size() << endl;
#endif
PyObject * result = PyEval_EvalCode(py_handle_packet, glob, glob);
PyGC_Collect();
#ifdef DEBUG
cerr << "[DEBUG] [handle_packet] End of python call" << endl;
#endif
del_item_from_glob("__firegex_packet_info");
if (PyErr_Occurred()){