--- net-snmp-5.4.1.1/agent/mibgroup/host/hr_swinst.c.jbj	2008-09-06 09:11:42.000000000 -0400
+++ net-snmp-5.4.1.1/agent/mibgroup/host/hr_swinst.c	2008-09-06 09:12:11.000000000 -0400
@@ -41,8 +41,10 @@
 #endif
 
 #ifdef HAVE_LIBRPM
+#include <stdio.h>
+#include <stdint.h>
 #include <rpm/rpmlib.h>
-#include <rpm/header.h>
+#include <rpm/rpm4compat.h>
 #include <fcntl.h>
 
 #ifdef HAVE_RPMGETPATH
@@ -465,6 +467,7 @@ var_hrswinst(struct variable * vp,
             if ( headerGetEntry(swi->swi_h, RPMTAG_INSTALLTIME, NULL, (void **) &rpm_data, NULL) ) {
                 time_t          installTime = *rpm_data;
                 ret = date_n_time(&installTime, var_len);
+		free((void *)rpm_data);
             } else {
                 ret = date_n_time(0, var_len);
             }
@@ -661,6 +664,9 @@ Save_HR_SW_info(int ix)
                        NULL);
         snprintf(swi->swi_name, sizeof(swi->swi_name), "%s-%s-%s", n, v, r);
         swi->swi_name[ sizeof(swi->swi_name)-1 ] = 0;
+	free((void *)n);
+	free((void *)v);
+	free((void *)r);
     }
 #else
     snprintf(swi->swi_name, sizeof(swi->swi_name), swi->swi_dep->d_name);
--- net-snmp-5.4.1.1/configure.jbj	2008-09-06 09:10:46.000000000 -0400
+++ net-snmp-5.4.1.1/configure	2008-09-06 09:14:56.000000000 -0400
@@ -25823,7 +25823,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 #include NETSNMP_SYSTEM_INCLUDE_FILE
 #include "$srcdir/$mibdir/$i.h"
 _ACEOF
-    mv conftest.$ac_ext module_tmp_header.h
+    mv conftest.$ac_ext module_tmp_rpmtag.h
 
     #---------------------
     # macro: config_belongs_in(ARG)
@@ -25834,7 +25834,7 @@ _ACEOF
     module_type=mib_module
     if test -f $srcdir/$mibdir/$i.h; then
 
-      module_type=`$MODULECPP module_tmp_header.h | grep config_belongs_in | sed 's@.*config_belongs_in(\([^)]*\)).*@\1@'`
+      module_type=`$MODULECPP module_tmp_rpmtag.h | grep config_belongs_in | sed 's@.*config_belongs_in(\([^)]*\)).*@\1@'`
 
     fi
     if test "x$module_type" = "x" ; then
@@ -25934,7 +25934,7 @@ _ACEOF
       	#
         # check if $i has any conflicts
         #
-	new_list_excl=`$MODULECPP module_tmp_header.h | grep config_exclude | sed 's/.*config_exclude(\(.*\)).*/\1/'`
+	new_list_excl=`$MODULECPP module_tmp_rpmtag.h | grep config_exclude | sed 's/.*config_exclude(\(.*\)).*/\1/'`
 	if test "x$new_list_excl" != "x"; then
 
   if test $module_debug = 1; then
@@ -25980,7 +25980,7 @@ EOF
         # check if $i has any architecture specific requirements
         #
 
-        new_list_arch=`$MODULECPP module_tmp_header.h | grep config_arch_require | sed 's/.*config_arch_require( *\([^ ]*\) *, *\([^ ]*\) *).*/\1-xarchx-\2/'`
+        new_list_arch=`$MODULECPP module_tmp_rpmtag.h | grep config_arch_require | sed 's/.*config_arch_require( *\([^ ]*\) *, *\([^ ]*\) *).*/\1-xarchx-\2/'`
 
 	if test "x$new_list_arch" != "x"; then
           for j in $new_list_arch
@@ -26011,7 +26011,7 @@ EOF
         #
         # check if $i has any other required modules
         #
-	new_list="$new_list `$MODULECPP module_tmp_header.h | grep config_require | sed 's/.*config_require(\(.*\)).*/\1/'`"
+	new_list="$new_list `$MODULECPP module_tmp_rpmtag.h | grep config_require | sed 's/.*config_require(\(.*\)).*/\1/'`"
 
   if test $module_debug = 1; then
     echo " $i will test: $new_list"
@@ -26072,7 +26072,7 @@ EOF
         #
         # check if $i has any mibs to add
         #
-	new_mibs=`$MODULECPP module_tmp_header.h | grep config_add_mib | sed 's/.*config_add_mib(\(.*\)).*/\1/'`
+	new_mibs=`$MODULECPP module_tmp_rpmtag.h | grep config_add_mib | sed 's/.*config_add_mib(\(.*\)).*/\1/'`
 	if test "x$new_mibs" != "x"; then
 	    for j in $new_mibs
 		do
@@ -26113,7 +26113,7 @@ EOF
         #-------------------
         # check for unsupported config_load_mib
         #
-        if $MODULECPP module_tmp_header.h | grep config_load_mib > /dev/null 2>&1; then
+        if $MODULECPP module_tmp_rpmtag.h | grep config_load_mib > /dev/null 2>&1; then
           { echo "$as_me:$LINENO: WARNING: mib module error" >&5
 echo "$as_me: WARNING: mib module error" >&2;}
       	  { echo "$as_me:$LINENO: WARNING: mib module \"$i\" uses the \"config_load_mib\" directive, which is no longer supported.  It probably won't work." >&5
@@ -26125,7 +26125,7 @@ echo "$as_me: WARNING: mib module \"$i\"
         #  (generally not used any longer; old auto-load a .conf token)
         #
 
-        $MODULECPP module_tmp_header.h | grep config_parse_dot_conf | sed 's@.*config_parse_dot_conf(\([^)]*\), *\([^),]*\), *\([^),]*\), *\([^),]*\)).*@register_config_handler("snmpd",\1, \2, \3, \4);@' >> $mibdir/mib_module_dot_conf.h
+        $MODULECPP module_tmp_rpmtag.h | grep config_parse_dot_conf | sed 's@.*config_parse_dot_conf(\([^)]*\), *\([^),]*\), *\([^),]*\), *\([^),]*\)).*@register_config_handler("snmpd",\1, \2, \3, \4);@' >> $mibdir/mib_module_dot_conf.h
 
 
         #---------------------
@@ -26134,7 +26134,7 @@ echo "$as_me: WARNING: mib module \"$i\"
         #
         # check if $i has any errors, or warnings
         #
-	error=`$MODULECPP module_tmp_header.h | grep config_error | sed 's/.*config_error(\(.*\)).*/\1/'`
+	error=`$MODULECPP module_tmp_rpmtag.h | grep config_error | sed 's/.*config_error(\(.*\)).*/\1/'`
 	if test "x$error" != "x"; then
           echo
           echo
@@ -26147,7 +26147,7 @@ echo "$as_me: error: $i: *** $error ***"
       	# macro: config_warning(warning text)
       	#  - used to signal a configuration "warning" to be printed to the user
         #
-	warning=`$MODULECPP module_tmp_header.h | grep config_warning | sed 's/.*config_warning(\(.*\)).*/\1/'`
+	warning=`$MODULECPP module_tmp_rpmtag.h | grep config_warning | sed 's/.*config_warning(\(.*\)).*/\1/'`
 	if test "x$warning" != "x"; then
           all_warnings="$all_warnings $warning
 "
@@ -26384,7 +26384,7 @@ EOFOCFIN
 done
 
 # cleanup
-rm -f module_tmp_header.h
+rm -f module_tmp_rpmtag.h
 
 #-------------------
 # build module lists for Makefiles
@@ -28388,8 +28388,7 @@ rm -f conftest.err conftest.$ac_objext \
 fi;
 
 
-
-for ac_header in rpm/rpmlib.h rpm/header.h
+for ac_header in rpm/rpmlib.h rpm/rpmtag.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -28684,8 +28683,8 @@ fi
 
 
 if test "${ac_cv_header_rpm_header_h+set}" = set; then
-  echo "$as_me:$LINENO: checking for rpm/header.h" >&5
-echo $ECHO_N "checking for rpm/header.h... $ECHO_C" >&6
+  echo "$as_me:$LINENO: checking for rpm/rpmtag.h" >&5
+echo $ECHO_N "checking for rpm/rpmtag.h... $ECHO_C" >&6
 if test "${ac_cv_header_rpm_header_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 fi
@@ -28693,8 +28692,8 @@ echo "$as_me:$LINENO: result: $ac_cv_hea
 echo "${ECHO_T}$ac_cv_header_rpm_header_h" >&6
 else
   # Is the header compilable?
-echo "$as_me:$LINENO: checking rpm/header.h usability" >&5
-echo $ECHO_N "checking rpm/header.h usability... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking rpm/rpmtag.h usability" >&5
+echo $ECHO_N "checking rpm/rpmtag.h usability... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
@@ -28702,7 +28701,7 @@ cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
 $ac_includes_default
-#include <rpm/header.h>
+#include <rpm/rpmtag.h>
 _ACEOF
 rm -f conftest.$ac_objext
 if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
@@ -28738,15 +28737,15 @@ echo "$as_me:$LINENO: result: $ac_header
 echo "${ECHO_T}$ac_header_compiler" >&6
 
 # Is the header present?
-echo "$as_me:$LINENO: checking rpm/header.h presence" >&5
-echo $ECHO_N "checking rpm/header.h presence... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking rpm/rpmtag.h presence" >&5
+echo $ECHO_N "checking rpm/rpmtag.h presence... $ECHO_C" >&6
 cat >conftest.$ac_ext <<_ACEOF
 /* confdefs.h.  */
 _ACEOF
 cat confdefs.h >>conftest.$ac_ext
 cat >>conftest.$ac_ext <<_ACEOF
 /* end confdefs.h.  */
-#include <rpm/header.h>
+#include <rpm/rpmtag.h>
 _ACEOF
 if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
   (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
@@ -28780,25 +28779,25 @@ echo "${ECHO_T}$ac_header_preproc" >&6
 # So?  What about this header?
 case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
   yes:no: )
-    { echo "$as_me:$LINENO: WARNING: rpm/header.h: accepted by the compiler, rejected by the preprocessor!" >&5
-echo "$as_me: WARNING: rpm/header.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
-    { echo "$as_me:$LINENO: WARNING: rpm/header.h: proceeding with the compiler's result" >&5
-echo "$as_me: WARNING: rpm/header.h: proceeding with the compiler's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: rpm/rpmtag.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: rpm/rpmtag.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: rpm/rpmtag.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: rpm/rpmtag.h: proceeding with the compiler's result" >&2;}
     ac_header_preproc=yes
     ;;
   no:yes:* )
-    { echo "$as_me:$LINENO: WARNING: rpm/header.h: present but cannot be compiled" >&5
-echo "$as_me: WARNING: rpm/header.h: present but cannot be compiled" >&2;}
-    { echo "$as_me:$LINENO: WARNING: rpm/header.h:     check for missing prerequisite headers?" >&5
-echo "$as_me: WARNING: rpm/header.h:     check for missing prerequisite headers?" >&2;}
-    { echo "$as_me:$LINENO: WARNING: rpm/header.h: see the Autoconf documentation" >&5
-echo "$as_me: WARNING: rpm/header.h: see the Autoconf documentation" >&2;}
-    { echo "$as_me:$LINENO: WARNING: rpm/header.h:     section \"Present But Cannot Be Compiled\"" >&5
-echo "$as_me: WARNING: rpm/header.h:     section \"Present But Cannot Be Compiled\"" >&2;}
-    { echo "$as_me:$LINENO: WARNING: rpm/header.h: proceeding with the preprocessor's result" >&5
-echo "$as_me: WARNING: rpm/header.h: proceeding with the preprocessor's result" >&2;}
-    { echo "$as_me:$LINENO: WARNING: rpm/header.h: in the future, the compiler will take precedence" >&5
-echo "$as_me: WARNING: rpm/header.h: in the future, the compiler will take precedence" >&2;}
+    { echo "$as_me:$LINENO: WARNING: rpm/rpmtag.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: rpm/rpmtag.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: rpm/rpmtag.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: rpm/rpmtag.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: rpm/rpmtag.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: rpm/rpmtag.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: rpm/rpmtag.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: rpm/rpmtag.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: rpm/rpmtag.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: rpm/rpmtag.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: rpm/rpmtag.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: rpm/rpmtag.h: in the future, the compiler will take precedence" >&2;}
     (
       cat <<\_ASBOX
 ## ---------------------------------------------------- ##
@@ -28809,8 +28808,8 @@ _ASBOX
       sed "s/^/$as_me: WARNING:     /" >&2
     ;;
 esac
-echo "$as_me:$LINENO: checking for rpm/header.h" >&5
-echo $ECHO_N "checking for rpm/header.h... $ECHO_C" >&6
+echo "$as_me:$LINENO: checking for rpm/rpmtag.h" >&5
+echo $ECHO_N "checking for rpm/rpmtag.h... $ECHO_C" >&6
 if test "${ac_cv_header_rpm_header_h+set}" = set; then
   echo $ECHO_N "(cached) $ECHO_C" >&6
 else