From bcc42b32b7db86fe8c26d93226e0a4887e0b3d0b Mon Sep 17 00:00:00 2001 From: Packit Service Date: Dec 03 2020 08:13:59 +0000 Subject: Apply patch net-snmp-5.8-rpm-memory-leak.patch patch_name: net-snmp-5.8-rpm-memory-leak.patch present_in_specfile: true --- diff --git a/agent/mibgroup/host/data_access/swinst_rpm.c b/agent/mibgroup/host/data_access/swinst_rpm.c index f6bb2e0..0f4ed9e 100644 --- a/agent/mibgroup/host/data_access/swinst_rpm.c +++ b/agent/mibgroup/host/data_access/swinst_rpm.c @@ -75,6 +75,9 @@ netsnmp_swinst_arch_init(void) snprintf( pkg_directory, SNMP_MAXPATH, "%s/Packages", dbpath ); SNMP_FREE(rpmdbpath); dbpath = NULL; +#ifdef HAVE_RPMGETPATH + rpmFreeRpmrc(); +#endif if (-1 == stat( pkg_directory, &stat_buf )) { snmp_log(LOG_ERR, "Can't find directory of RPM packages"); pkg_directory[0] = '\0'; diff --git a/agent/mibgroup/host/hr_swinst.c b/agent/mibgroup/host/hr_swinst.c index c2cf5e5..f640f94 100644 --- a/agent/mibgroup/host/hr_swinst.c +++ b/agent/mibgroup/host/hr_swinst.c @@ -231,6 +231,9 @@ init_hr_swinst(void) snprintf(path, sizeof(path), "%s/packages.rpm", swi->swi_dbpath); path[ sizeof(path)-1 ] = 0; swi->swi_directory = strdup(path); +#ifdef HAVE_RPMGETPATH + rpmFreeRpmrc(); +#endif } #else # ifdef _PATH_HRSW_directory