summaryrefslogtreecommitdiff
path: root/ext/snmp
diff options
context:
space:
mode:
authorfoobar <sniper@php.net>2005-01-08 12:02:22 +0000
committerfoobar <sniper@php.net>2005-01-08 12:02:22 +0000
commit9ea10c5cecb49d2c9d5c513522b0ceba382ae8d5 (patch)
tree56fb6b6554d802173dc515d1b799bb0e28b97c69 /ext/snmp
parent688baca5a5bf27173c189c6a7ba01533dad80a7b (diff)
downloadphp-git-9ea10c5cecb49d2c9d5c513522b0ceba382ae8d5.tar.gz
- Fix some memory leaks
Diffstat (limited to 'ext/snmp')
-rw-r--r--ext/snmp/php_snmp.h1
-rw-r--r--ext/snmp/snmp.c18
2 files changed, 15 insertions, 4 deletions
diff --git a/ext/snmp/php_snmp.h b/ext/snmp/php_snmp.h
index e923ca11a3..6a33b7ba19 100644
--- a/ext/snmp/php_snmp.h
+++ b/ext/snmp/php_snmp.h
@@ -39,6 +39,7 @@ extern zend_module_entry snmp_module_entry;
#endif
PHP_MINIT_FUNCTION(snmp);
+PHP_MSHUTDOWN_FUNCTION(snmp);
PHP_MINFO_FUNCTION(snmp);
PHP_FUNCTION(snmpget);
diff --git a/ext/snmp/snmp.c b/ext/snmp/snmp.c
index 84d800c080..e8e0b01fd8 100644
--- a/ext/snmp/snmp.c
+++ b/ext/snmp/snmp.c
@@ -147,7 +147,7 @@ zend_module_entry snmp_module_entry = {
"snmp",
snmp_functions,
PHP_MINIT(snmp),
- NULL,
+ PHP_MSHUTDOWN(snmp),
NULL,
NULL,
PHP_MINFO(snmp),
@@ -174,7 +174,7 @@ static void php_snmp_init_globals(zend_snmp_globals *snmp_globals)
*/
PHP_MINIT_FUNCTION(snmp)
{
- init_snmp("snmpapp");
+ init_snmp("php");
ZEND_INIT_MODULE_GLOBALS(snmp, php_snmp_init_globals, NULL);
@@ -199,6 +199,16 @@ PHP_MINIT_FUNCTION(snmp)
}
/* }}} */
+/* {{{ PHP_MSHUTDOWN_FUNCTION
+ */
+PHP_MSHUTDOWN_FUNCTION(snmp)
+{
+ snmp_shutdown("php");
+
+ return SUCCESS;
+}
+/* }}} */
+
/* {{{ PHP_MINFO_FUNCTION
*/
PHP_MINFO_FUNCTION(snmp)
@@ -828,7 +838,7 @@ static int netsnmp_session_gen_auth_key(struct snmp_session *s, char *pass TSRML
s->securityAuthKeyLen = USM_AUTH_KU_LEN;
if (s->securityAuthProto == NULL) {
/* get .conf set default */
- oid *def = get_default_authtype(&(s->securityAuthProtoLen));
+ const oid *def = get_default_authtype(&(s->securityAuthProtoLen));
s->securityAuthProto = snmp_duplicate_objid(def, s->securityAuthProtoLen);
}
if (s->securityAuthProto == NULL) {
@@ -857,7 +867,7 @@ static int netsnmp_session_gen_sec_key(struct snmp_session *s, u_char *pass TSRM
s->securityPrivKeyLen = USM_PRIV_KU_LEN;
if (s->securityPrivProto == NULL) {
/* get .conf set default */
- oid *def = get_default_privtype(&(s->securityPrivProtoLen));
+ const oid *def = get_default_privtype(&(s->securityPrivProtoLen));
s->securityPrivProto = snmp_duplicate_objid(def, s->securityPrivProtoLen);
}
if (s->securityPrivProto == NULL) {