diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-12-09 10:38:56 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-12-09 10:38:56 +0000 |
| commit | 33c537482ce46bb741ab698de5079a5f2a98c055 (patch) | |
| tree | a79e4fff98142c58137d1154ddda6b2c8086c2c7 /src/libs | |
| parent | 23d2e89daaab810cdc921bd91fea1197193a84fa (diff) | |
- fixed conflict with MySQL headers (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@2402 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/libs')
| -rw-r--r-- | src/libs/zbxsysinfo/common/common.c | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/libs/zbxsysinfo/common/common.c b/src/libs/zbxsysinfo/common/common.c index b6c3a65e..d142d1cc 100644 --- a/src/libs/zbxsysinfo/common/common.c +++ b/src/libs/zbxsysinfo/common/common.c @@ -183,12 +183,18 @@ void escape_string(char *from, char *to, int maxlen) to[maxlen-1]=0; } -void free_list(LIST *list) +static void init_result_list(ZBX_LIST *list) +{ + /* don't use `free_result_list(list)`, dangerous recycling */ + + /* nothin to do */ +} +static void free_result_list(ZBX_LIST *list) { /* nothin to do */ } -int copy_list(LIST *src, LIST *dist) +static int copy_result_list(ZBX_LIST *src, ZBX_LIST *dist) { /* nothin to do */ return 0; @@ -214,7 +220,7 @@ int copy_result(AGENT_RESULT *src, AGENT_RESULT *dist) if(!dist->msg) return 1; } - return copy_list(&(src->list), &(dist->list)); + return copy_result_list(&(src->list), &(dist->list)); } void free_result(AGENT_RESULT *result) @@ -230,18 +236,26 @@ void free_result(AGENT_RESULT *result) free(result->msg); } - free_list(&(result->list)); + if(result->type & AR_LIST) + { + free_result_list(&(result->list)); + } init_result(result); } void init_result(AGENT_RESULT *result) { - result->str = NULL; - result->msg = NULL; + /* don't use `free_result(result)`, dangerous recycling */ + result->type = 0; + + result->ui64 = 0; result->dbl = 0; - result->ui64 = 0; + result->str = NULL; + result->msg = NULL; + + init_result_list(&(result->list)); } int parse_command( /* return value: 0 - error; 1 - command without parameters; 2 - command with parameters */ |
