From 2d76b271c36ca347917c91bc22e812d9c786315d Mon Sep 17 00:00:00 2001 From: osmiy Date: Thu, 24 May 2007 07:34:33 +0000 Subject: - added delta value calculation for UINT64 (Eugene) git-svn-id: svn://svn.zabbix.com/trunk@4164 97f52cf1-0a1b-0410-bd0e-c28be96e8082 --- src/libs/zbxsysinfo/sysinfo.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'src/libs/zbxsysinfo') diff --git a/src/libs/zbxsysinfo/sysinfo.c b/src/libs/zbxsysinfo/sysinfo.c index 570f6c95..bc1f1a83 100644 --- a/src/libs/zbxsysinfo/sysinfo.c +++ b/src/libs/zbxsysinfo/sysinfo.c @@ -69,7 +69,7 @@ void add_metric(ZBX_METRIC *new) commands[i].test_param=strdup(new->test_param); commands = zbx_realloc(commands,(i+2)*sizeof(ZBX_METRIC)); - commands[i+1].key=NULL; + memset(&commands[i+1], 0, sizeof(ZBX_METRIC)); break; } } @@ -135,7 +135,7 @@ void add_user_parameter(char *key,char *command) } } -void init_metrics() +void init_metrics(void) { register int i; @@ -164,6 +164,23 @@ void init_metrics() #endif /* USE_SIMPLE_METRICS */ } +void free_metrics(void) +{ + int i = 0; + + if( commands ) + { + for(i=0; NULL == commands[i].key; i++) + { + zbx_free(commands[i].key); + zbx_free(commands[i].main_param); + zbx_free(commands[i].test_param); + } + + zbx_free(commands); + } +} + void escape_string(char *from, char *to, int maxlen) { register int i,ptr; -- cgit