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

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