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

Error message logged during javascript preprocessing

    XMLWordPrintable

    Details

    • Team:
      Team A
    • Sprint:
      Sprint 64 (May 2020)
    • Story Points:
      0.25

      Description

      Javascript preprocessing will log the following error messages:

      15390:20200514:192123.424 [file:str.c,line:2396] zbx_malloc: allocating already allocated memory. Please report this to Zabbix developers.
      

      While harmless, it still needs to be fixed either by:

      diff --git a/src/zabbix_server/preprocessor/item_preproc.c b/src/zabbix_server/preprocessor/item_preproc.c
      index 4be0598b8b..f8271d6d7d 100644
      --- a/src/zabbix_server/preprocessor/item_preproc.c
      +++ b/src/zabbix_server/preprocessor/item_preproc.c
      @@ -1566,7 +1566,7 @@ static int        item_preproc_throttle_timed_value(zbx_variant_t *value, const zbx_tim
        ******************************************************************************/
       static int     item_preproc_script(zbx_variant_t *value, const char *params, zbx_variant_t *bytecode, char **errmsg)
       {
      -       char    *code, *output, *error = NULL;
      +       char    *code, *output = NULL, *error = NULL;
              int     size;
       
              if (FAIL == item_preproc_convert_value(value, ZBX_VARIANT_STR, errmsg))
      

      or

      diff --git a/src/libs/zbxcommon/str.c b/src/libs/zbxcommon/str.c
      index 6d7f319a97..5f52db26e8 100644
      --- a/src/libs/zbxcommon/str.c
      +++ b/src/libs/zbxcommon/str.c
      @@ -2393,7 +2393,7 @@ int       zbx_cesu8_to_utf8(const char *cesu8, char **utf8)
              size_t          len;
       
              len = strlen(cesu8);
      -       out = *utf8 = zbx_malloc(*utf8, len + 1);
      +       out = *utf8 = zbx_malloc(NULL, len + 1);
              end = cesu8 + len;
       
              for (in = cesu8; in < end;)
      

      Quite possible in the second case we could also remove NULL initializations for few variables.

        Attachments

          Activity

            People

            Assignee:
            wiper Andris Zeila
            Reporter:
            wiper Andris Zeila
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: