summaryrefslogtreecommitdiffstats
path: root/src/libs/zbxsysinfo/common
diff options
context:
space:
mode:
authorosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-06-28 14:57:47 +0000
committerosmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082>2007-06-28 14:57:47 +0000
commita9ac3677ee5b18f69744bc6af176f4a1cea204bd (patch)
tree1b3e55e9358dfe957a0b7c72f41b7b9903cf2d37 /src/libs/zbxsysinfo/common
parentb5470f1eb1d5599480b89f565f4ea10d79d86580 (diff)
downloadzabbix-a9ac3677ee5b18f69744bc6af176f4a1cea204bd.tar.gz
zabbix-a9ac3677ee5b18f69744bc6af176f4a1cea204bd.tar.xz
zabbix-a9ac3677ee5b18f69744bc6af176f4a1cea204bd.zip
- fixed UserParameters crash on linux
git-svn-id: svn://svn.zabbix.com/trunk@4381 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/libs/zbxsysinfo/common')
-rw-r--r--src/libs/zbxsysinfo/common/common.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/libs/zbxsysinfo/common/common.c b/src/libs/zbxsysinfo/common/common.c
index 58b6ceb9..aba029f4 100644
--- a/src/libs/zbxsysinfo/common/common.c
+++ b/src/libs/zbxsysinfo/common/common.c
@@ -232,7 +232,7 @@ int EXECUTE_STR(const char *cmd, const char *param, unsigned flags, AGENT_RESULT
#else /* not _WINDOWS */
- zbx_strlcpy(command, param, sizeof(command));
+ command = zbx_dsprintf(command, param);
if(0 == (hRead = popen(command,"r")))
{
@@ -272,6 +272,8 @@ int EXECUTE_STR(const char *cmd, const char *param, unsigned flags, AGENT_RESULT
goto lbl_exit;
}
+ hRead = NULL;
+
#endif /* _WINDOWS */
zabbix_log(LOG_LEVEL_DEBUG, "Before");
@@ -294,10 +296,10 @@ int EXECUTE_STR(const char *cmd, const char *param, unsigned flags, AGENT_RESULT
lbl_exit:
#if defined(_WINDOWS)
- if ( hWrite ) CloseHandle(hWrite); hWrite = NULL;
- if ( hRead) CloseHandle(hRead); hRead = NULL;
+ if ( hWrite ) { CloseHandle(hWrite); hWrite = NULL; }
+ if ( hRead) { CloseHandle(hRead); hRead = NULL; }
#else /* not _WINDOWS */
- if ( hRead ) pclose(hRead); hRead = NULL;
+ if ( hRead ) { pclose(hRead); hRead = NULL; }
#endif /* _WINDOWS */
zbx_free(command)