summaryrefslogtreecommitdiff
path: root/third_party/heimdal/lib/sl/sl.c
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/heimdal/lib/sl/sl.c')
-rw-r--r--third_party/heimdal/lib/sl/sl.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/third_party/heimdal/lib/sl/sl.c b/third_party/heimdal/lib/sl/sl.c
index 03f577b5f59..b78f9f675b2 100644
--- a/third_party/heimdal/lib/sl/sl.c
+++ b/third_party/heimdal/lib/sl/sl.c
@@ -460,6 +460,8 @@ sl_did_you_mean(SL_cmd *cmds, const char *match)
for (n = 0, c = cmds; c->name; c++, n++)
;
+ if (n == 0)
+ return;
metrics = calloc(n, sizeof(metrics[0]));
if (metrics == NULL)
return;