Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-21725

Memory leak in user macro cache when removing vault macros

XMLWordPrintable

    • Team A
    • Sprint 93 (Oct 2022)
    • 0.125

      When deregistering kv paths the kvs hashset record is removed without releasing string data it holds.

      diff --git a/src/libs/zbxdbcache/user_macro.c b/src/libs/zbxdbcache/user_macro.c
      index ae2cc7a4e05..66c0417a6f7 100644
      --- a/src/libs/zbxdbcache/user_macro.c
      +++ b/src/libs/zbxdbcache/user_macro.c
      @@ -419,6 +419,10 @@ static void        um_macro_kv_remove(zbx_um_macro_t *macro, zbx_dc_macro_kv_t *mkv)
                      if (0 == mkv->kv->macros.values_num)
                      {
                              zbx_vector_uint64_pair_destroy(&mkv->kv->macros);
      +                       dc_strpool_release(mkv->kv->key);
      +                       if (NULL != mkv->kv->value)
      +                               dc_strpool_release(mkv->kv->value);
      +
                              zbx_hashset_remove_direct(&mkv->kv_path->kvs, mkv->kv);
                              if (0 == mkv->kv_path->kvs.num_data)
                                      dc_kvs_path_remove(mkv->kv_path);
      
      

            wiper Andris Zeila
            wiper Andris Zeila
            Team A
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: