summaryrefslogtreecommitdiffstats
path: root/cli/src/cli-cmd-volume.c
diff options
context:
space:
mode:
authorAmar Tumballi <amarts@redhat.com>2012-03-27 18:22:15 +0530
committerVijay Bellur <vijay@gluster.com>2012-04-02 02:44:47 -0700
commitb0bb1a2c979078efa3ab024e14119df6087c4320 (patch)
tree1ef163912d342ff1f595dfcc4e9791d22dde7a67 /cli/src/cli-cmd-volume.c
parentdc2a52fa0d83ba2e807a175655fc0362b707a22d (diff)
cli: do the proper STACK_DESTORY of created frames
* fixes memory leaks * fixes some random local mem-pool empty messages Change-Id: Ic79f279f2acfe4722fa54d52397d0267b3918928 Signed-off-by: Amar Tumballi <amarts@redhat.com> BUG: 803638 Reviewed-on: http://review.gluster.com/3018 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Kaushal M <kaushal@redhat.com> Reviewed-by: Jeff Darcy <jdarcy@redhat.com> Reviewed-by: Vijay Bellur <vijay@gluster.com>
Diffstat (limited to 'cli/src/cli-cmd-volume.c')
-rw-r--r--cli/src/cli-cmd-volume.c71
1 files changed, 70 insertions, 1 deletions
diff --git a/cli/src/cli-cmd-volume.c b/cli/src/cli-cmd-volume.c
index 7ba4e838f55..6b65d5f85be 100644
--- a/cli/src/cli-cmd-volume.c
+++ b/cli/src/cli-cmd-volume.c
@@ -106,7 +106,7 @@ out:
}
frame->local = NULL;
if (frame)
- FRAME_DESTROY (frame);
+ STACK_DESTROY (frame->root);
return ret;
@@ -175,6 +175,9 @@ out:
if (dict)
dict_unref (dict);
+ if (frame)
+ STACK_DESTROY (frame->root);
+
return ret;
}
@@ -401,6 +404,9 @@ out:
cli_out ("Volume create failed");
}
+ if (frame)
+ STACK_DESTROY (frame->root);
+
return ret;
}
@@ -452,6 +458,9 @@ out:
cli_out ("Volume delete failed");
}
+ if (frame)
+ STACK_DESTROY (frame->root);
+
return ret;
}
@@ -529,6 +538,9 @@ out:
cli_out ("Volume start failed");
}
+ if (frame)
+ STACK_DESTROY (frame->root);
+
return ret;
}
@@ -648,6 +660,10 @@ out:
}
if (dict)
dict_unref (dict);
+
+ if (frame)
+ STACK_DESTROY (frame->root);
+
return ret;
}
@@ -704,6 +720,9 @@ out:
cli_out ("Volume rename on '%s' failed", (char *)words[2]);
}
+ if (frame)
+ STACK_DESTROY (frame->root);
+
return ret;
}
@@ -799,6 +818,9 @@ out:
cli_out ("Volume rebalance failed");
}
+ if (frame)
+ STACK_DESTROY (frame->root);
+
return ret;
}
@@ -842,6 +864,9 @@ out:
cli_out ("Volume reset failed");
}
+ if (frame)
+ STACK_DESTROY (frame->root);
+
return ret;
}
@@ -886,6 +911,9 @@ out:
cli_out ("Volume profile failed");
}
+ if (frame)
+ STACK_DESTROY (frame->root);
+
return ret;
}
@@ -930,6 +958,9 @@ out:
cli_out ("Volume set failed");
}
+ if (frame)
+ STACK_DESTROY (frame->root);
+
return ret;
}
@@ -992,6 +1023,9 @@ out:
cli_out ("Volume add-brick failed");
}
+ if (frame)
+ STACK_DESTROY (frame->root);
+
return ret;
}
@@ -1044,6 +1078,9 @@ out:
if (ret && parse_err == 0)
cli_out ("Quota command failed");
+ if (frame)
+ STACK_DESTROY (frame->root);
+
return ret;
}
@@ -1102,6 +1139,10 @@ out:
if (options)
dict_unref (options);
+
+ if (frame)
+ STACK_DESTROY (frame->root);
+
return ret;
}
@@ -1151,6 +1192,9 @@ out:
cli_out ("Volume replace-brick failed");
}
+ if (frame)
+ STACK_DESTROY (frame->root);
+
return ret;
}
@@ -1204,6 +1248,9 @@ out:
cli_out ("Volume top failed");
}
+ if (frame)
+ STACK_DESTROY (frame->root);
+
return ret;
}
@@ -1250,6 +1297,9 @@ out:
cli_out ("Volume log rotate failed");
}
+ if (frame)
+ STACK_DESTROY (frame->root);
+
return ret;
}
@@ -1352,6 +1402,9 @@ out:
if (ret && parse_err == 0)
cli_out (GEOREP" command failed");
+ if (frame)
+ STACK_DESTROY (frame->root);
+
return ret;
}
@@ -1397,6 +1450,10 @@ cli_cmd_volume_status_cbk (struct cli_state *state,
out:
if (dict)
dict_unref (dict);
+
+ if (frame)
+ STACK_DESTROY (frame->root);
+
return ret;
}
@@ -1624,6 +1681,9 @@ out:
if (options)
dict_unref (options);
+ if (frame)
+ STACK_DESTROY (frame->root);
+
return ret;
}
@@ -1676,6 +1736,9 @@ out:
cli_out ("Volume statedump failed");
}
+ if (frame)
+ STACK_DESTROY (frame->root);
+
return ret;
}
@@ -1704,6 +1767,9 @@ out:
cli_out ("Volume list failed");
}
+ if (frame)
+ STACK_DESTROY (frame->root);
+
return ret;
}
@@ -1758,6 +1824,9 @@ out:
cli_out ("Volume clear-locks failed");
}
+ if (frame)
+ STACK_DESTROY (frame->root);
+
return ret;
}