From cd4fd271c6636ecc100171403b324a65a9e77fe2 Mon Sep 17 00:00:00 2001 From: shishir gowda Date: Fri, 1 Apr 2011 03:24:12 +0000 Subject: 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 Signed-off-by: Vijay Bellur BUG: 2645 (volume top write-perf results in memory corruption) URL: http://bugs.gluster.com/cgi-bin/bugzilla3/show_bug.cgi?id=2645 --- cli/src/cli-cmd-parser.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cli/src/cli-cmd-parser.c') 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; -- cgit