diff --git a/channels/chan_dahdi.c b/channels/chan_dahdi.c index a24ed5fa72..3141856871 100644 --- a/channels/chan_dahdi.c +++ b/channels/chan_dahdi.c @@ -11697,7 +11697,9 @@ static char *complete_span_helper(const char *line, const char *word, int pos, i for (which = span = 0; span < NUM_SPANS; span++) { if (pris[span].pri && ++which > state) { - asprintf(&ret, "%d", span + 1); /* user indexes start from 1 */ + if (asprintf(&ret, "%d", span + 1) < 0) { /* user indexes start from 1 */ + ast_log(LOG_WARNING, "asprintf() failed: %s\n", strerror(errno)); + } break; } }