From c1428abe7908fb5a598f2d4730bc1c7f1740309e Mon Sep 17 00:00:00 2001 From: seanbright Date: Tue, 7 Dec 2010 15:23:18 +0000 Subject: 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 --- main/astobj2.c | 4 ++++ 1 file changed, 4 insertions(+) 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); -- cgit v1.2.3