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

Memory leak when trying to use regexp_compile() for regular expression validation

    Details

    • Team:
      Team A
    • Sprint:
      Sprint 46, Nov 2018
    • Story Points:
      0.125

      Description

      Index: src/libs/zbxregexp/zbxregexp.c
      ===================================================================
      --- src/libs/zbxregexp/zbxregexp.c	(revision 86088)
      +++ src/libs/zbxregexp/zbxregexp.c	(working copy)
      @@ -61,12 +61,15 @@
       	if(NULL == pcre_regexp)
       		return FAIL;
       
      -	if(regexp)
      +	if (NULL != regexp)
       	{
       		*regexp = (zbx_regexp_t *)zbx_malloc(NULL, sizeof(zbx_regexp_t));
       		(*regexp)->pcre_regexp = pcre_regexp;
       	}
      +	else
      +		pcre_free(pcre_regexp);
       
      +
       	return SUCCEED;
       }
       
      

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: