Blame SOURCES/net-snmp-5.8-rpm-memory-leak.patch

0e8785
diff -urNp a/agent/mibgroup/host/data_access/swinst_rpm.c b/agent/mibgroup/host/data_access/swinst_rpm.c
0e8785
--- a/agent/mibgroup/host/data_access/swinst_rpm.c	2020-06-10 14:32:43.330486233 +0200
0e8785
+++ b/agent/mibgroup/host/data_access/swinst_rpm.c	2020-06-10 14:35:46.672298741 +0200
0e8785
@@ -75,6 +75,9 @@ netsnmp_swinst_arch_init(void)
0e8785
     snprintf( pkg_directory, SNMP_MAXPATH, "%s/Packages", dbpath );
0e8785
     SNMP_FREE(rpmdbpath);
0e8785
     dbpath = NULL;
0e8785
+#ifdef HAVE_RPMGETPATH
0e8785
+    rpmFreeRpmrc();
0e8785
+#endif
0e8785
     if (-1 == stat( pkg_directory, &stat_buf )) {
0e8785
         snmp_log(LOG_ERR, "Can't find directory of RPM packages");
0e8785
         pkg_directory[0] = '\0';
0e8785
diff -urNp a/agent/mibgroup/host/hr_swinst.c b/agent/mibgroup/host/hr_swinst.c
0e8785
--- a/agent/mibgroup/host/hr_swinst.c	2020-06-10 14:32:43.325486184 +0200
0e8785
+++ b/agent/mibgroup/host/hr_swinst.c	2020-06-10 14:36:44.423872418 +0200
0e8785
@@ -231,6 +231,9 @@ init_hr_swinst(void)
0e8785
             snprintf(path, sizeof(path), "%s/packages.rpm", swi->swi_dbpath);
0e8785
         path[ sizeof(path)-1 ] = 0;
0e8785
         swi->swi_directory = strdup(path);
0e8785
+#ifdef HAVE_RPMGETPATH
0e8785
+        rpmFreeRpmrc();
0e8785
+#endif
0e8785
     }
0e8785
 #else
0e8785
 #  ifdef _PATH_HRSW_directory