diff --git a/main/astmm.c b/main/astmm.c
index 099f12561bbc18a538fda1b7d773cb2c85bc451c..fd0b3d6fa98b6d6380e3d96b12ac1acdaf387679 100644
--- a/main/astmm.c
+++ b/main/astmm.c
@@ -391,7 +391,7 @@ static char *handle_memory_show_summary(struct ast_cli_entry *e, int cmd, struct
 			"Usage: memory show summary [<file>]\n"
 			"       Summarizes heap memory allocations by file, or optionally\n"
 			"by function, if a file is specified\n";
-		break;
+		return NULL;
 	case CLI_GENERATE:
 		return NULL;
 	}