summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshishir gowda <shishirng@gluster.com>2011-04-01 03:24:12 +0000
committerVijay Bellur <vijay@dev.gluster.com>2011-04-01 06:08:33 -0700
commitcd4fd271c6636ecc100171403b324a65a9e77fe2 (patch)
treec86febf72ba00dd56600f3e8ba836aaa96ae83bc
parent5c709704ab5767b55f4eef7cddea52e18e2a6d42 (diff)
Replace strdup call to gf_strdup as GF_FREE is being called
Also, fix validation of bs and count to <= 0. Signed-off-by: shishir gowda <shishirng@gluster.com> Signed-off-by: Vijay Bellur <vijay@dev.gluster.com> BUG: 2645 (volume top write-perf results in memory corruption) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2645
-rw-r--r--cli/src/cli-cmd-parser.c4
-rw-r--r--libglusterfs/src/common-utils.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/cli/src/cli-cmd-parser.c b/cli/src/cli-cmd-parser.c
index 799a64bb923..300091d978b 100644
--- a/cli/src/cli-cmd-parser.c
+++ b/cli/src/cli-cmd-parser.c
@@ -1343,7 +1343,7 @@ cli_cmd_volume_top_parse (const char **words, int wordcount,
ret = gf_is_str_int (value);
if (!ret)
blk_size = atoi (value);
- if (ret || (blk_size < 0)) {
+ if (ret || (blk_size <= 0)) {
cli_out ("block size should be an integer "
"greater than zero");
ret = -1;
@@ -1354,7 +1354,7 @@ cli_cmd_volume_top_parse (const char **words, int wordcount,
ret = gf_is_str_int (value);
if (!ret)
count = atoi(value);
- if (ret || (count < 0)) {
+ if (ret || (count <= 0)) {
cli_out ("count should be an integer greater "
"zero");
ret = -1;
diff --git a/libglusterfs/src/common-utils.c b/libglusterfs/src/common-utils.c
index 0d850740eee..e745ec0faf3 100644
--- a/libglusterfs/src/common-utils.c
+++ b/libglusterfs/src/common-utils.c
@@ -1783,7 +1783,7 @@ gf_is_str_int (const char *value)
GF_VALIDATE_OR_GOTO ("", value, out);
- str = strdup (value);
+ str = gf_strdup (value);
if (!str)
goto out;