diff options
| author | yangwei <[email protected]> | 2024-02-27 10:25:06 +0800 |
|---|---|---|
| committer | yangwei <[email protected]> | 2024-02-27 10:25:06 +0800 |
| commit | 57d25a17ab817f5a1b67d661cea7736bde6fe54a (patch) | |
| tree | e7f3ab1bf78455fe3465f3cabbd51568f2bbb1b3 | |
| parent | 144db8d7cd018aec32834078a0a8db8bfd81855b (diff) | |
🐞 fix(stellar_exit): fix invalid read when no plugin loadedv1.0.13
| -rw-r--r-- | src/adapter/adapter.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/adapter/adapter.c b/src/adapter/adapter.c index d9860c1..2936e8c 100644 --- a/src/adapter/adapter.c +++ b/src/adapter/adapter.c @@ -132,14 +132,18 @@ void stellar_exit(struct stellar *st) { if(!st)return; struct plugin_specific_inernal *p=NULL; - while ((p = (struct plugin_specific_inernal *)utarray_next(st->plugin_specs_array, p))) - { - if(p->specs.exit_cb)p->specs.exit_cb(p->plugin_ctx); - } - if(st->session_mq_schema_array)utarray_free(st->session_mq_schema_array); + if (st->plugin_specs_array) + { + while ((p = (struct plugin_specific_inernal *)utarray_next(st->plugin_specs_array, p))) + { + if (p->specs.exit_cb) + p->specs.exit_cb(p->plugin_ctx); + } + utarray_free(st->plugin_specs_array); + } + if(st->session_mq_schema_array)utarray_free(st->session_mq_schema_array); if(st->session_exdata_schema_array)utarray_free(st->session_exdata_schema_array); if(st->intrinsic_session_event_schema_array)utarray_free(st->intrinsic_session_event_schema_array); - if(st->plugin_specs_array)utarray_free(st->plugin_specs_array); FREE(st); return; }; |
