diff options
author | Jun Kuriyama <kuriyama@FreeBSD.org> | 2009-01-25 14:19:16 +0000 |
---|---|---|
committer | Jun Kuriyama <kuriyama@FreeBSD.org> | 2009-01-25 14:19:16 +0000 |
commit | 53bb537d6a56816f9280a7ec64ab7fe276faca97 (patch) | |
tree | 0471d0b1476616c3144ad770242f7e4e8a58b1ef /net-mgmt/net-snmp/files/patch-cache_handler.c | |
parent | Fix typo from upstream svn. (diff) |
Introduce SCTP-MIB patch for FreeBSD.
This patch was already submitted to upstream.
Submitted by: rrs
Notes
Notes:
svn path=/head/; revision=226846
Diffstat (limited to 'net-mgmt/net-snmp/files/patch-cache_handler.c')
-rw-r--r-- | net-mgmt/net-snmp/files/patch-cache_handler.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/net-mgmt/net-snmp/files/patch-cache_handler.c b/net-mgmt/net-snmp/files/patch-cache_handler.c new file mode 100644 index 000000000000..0bcb75fb057b --- /dev/null +++ b/net-mgmt/net-snmp/files/patch-cache_handler.c @@ -0,0 +1,34 @@ +--- agent/helpers/cache_handler.c.orig 2009-01-25 22:40:13.000000000 +0900 ++++ agent/helpers/cache_handler.c 2009-01-25 22:44:30.000000000 +0900 +@@ -173,6 +173,31 @@ + return cache; + } + ++/** frees a cache ++ */ ++int ++netsnmp_cache_free(netsnmp_cache *cache) ++{ ++ netsnmp_cache *pos; ++ ++ if (NULL == cache) ++ return SNMPERR_SUCCESS; ++ ++ for (pos = cache_head; pos; pos = pos->next) { ++ if (pos == cache) { ++ snmp_log(LOG_WARNING, "not freeing cache (still in list)\n"); ++ return SNMP_ERR_GENERR; ++ } ++ } ++ ++ if (cache->rootoid) ++ free(cache->rootoid); ++ ++ free(cache); ++ ++ return SNMPERR_SUCCESS; ++} ++ + /** callback function to call cache load function */ + static void + _timer_reload(unsigned int regNo, void *clientargs) |