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