aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
authorseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2010-12-07 15:23:18 +0000
committerseanbright <seanbright@f38db490-d61c-443f-a65b-d21fe96a405b>2010-12-07 15:23:18 +0000
commitc1428abe7908fb5a598f2d4730bc1c7f1740309e (patch)
treeaba7ed33f29e7d70695529138b4f9cddec2c2699 /main
parent99c687c8c10918a67eac75af7935cd56cbd1505b (diff)
Avoid a crash if we don't pass an argument to 'astobj2 test.'
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@297775 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main')
-rw-r--r--main/astobj2.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main/astobj2.c b/main/astobj2.c
index b88732ea2..12da832d6 100644
--- a/main/astobj2.c
+++ b/main/astobj2.c
@@ -758,6 +758,10 @@ static int handle_astobj2_test(int fd, int argc, char *argv[])
char *obj;
static int prof_id = -1;
+ if (argc != 3) {
+ return RESULT_SHOWUSAGE;
+ }
+
if (prof_id == -1)
prof_id = ast_add_profile("ao2_alloc", 0);