Skip to content

Commit

Permalink
if-mib/data_access/interface.c: plug a leak with pcre2
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsb authored and bvanassche committed May 22, 2023
1 parent 346b6f8 commit e5aadf1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion agent/mibgroup/if-mib/data_access/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -830,7 +830,7 @@ int netsnmp_access_interface_include(const char *name)
{
netsnmp_include_if_list *if_ptr;
#if defined(HAVE_PCRE2_H)
pcre2_match_data *ndx_match = pcre2_match_data_create(3, NULL);
pcre2_match_data *ndx_match;
#elif defined(HAVE_PCRE_H)
int found_ndx[3];
#endif
Expand All @@ -845,6 +845,9 @@ int netsnmp_access_interface_include(const char *name)
*/
return TRUE;

#if defined(HAVE_PCRE2_H)
ndx_match = pcre2_match_data_create(3, NULL);
#endif

for (if_ptr = include_list; if_ptr; if_ptr = if_ptr->next) {
#if defined(HAVE_PCRE2_H)
Expand Down

0 comments on commit e5aadf1

Please sign in to comment.