diff --git a/main/pbx.c b/main/pbx.c index e45495e5b188a7d8fb3da6ef82fb67b8957d1d06..151a791a4ff3f2e0ea4cfed783032e4fa22e5054 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -4556,10 +4556,6 @@ static int ext_strncpy(char *dst, const char *src, int len) return count; } -static void null_datad(void *foo) -{ -} - /*! \brief add the extension in the priority chain. * returns 0 on success, -1 on failure */ @@ -4581,7 +4577,8 @@ static int add_pri(struct ast_context *con, struct ast_exten *tmp, replacement? If so, replace, otherwise, bonk. */ if (!replace) { ast_log(LOG_WARNING, "Unable to register extension '%s', priority %d in '%s', already in use\n", tmp->exten, tmp->priority, con->name); - tmp->datad(tmp->data); + if (tmp->datad) + tmp->datad(tmp->data); free(tmp); return -1; } @@ -4599,7 +4596,8 @@ static int add_pri(struct ast_context *con, struct ast_exten *tmp, if (tmp->priority == PRIORITY_HINT) ast_change_hint(e,tmp); /* Destroy the old one */ - e->datad(e->data); + if (e->datad) + e->datad(e->data); free(e); } else { /* Slip ourselves in just before e */ tmp->peer = e; @@ -4683,8 +4681,6 @@ int ast_add_extension2(struct ast_context *con, length ++; /* just the '\0' */ /* Be optimistic: Build the extension structure first */ - if (datad == NULL) - datad = null_datad; if (!(tmp = ast_calloc(1, length))) return -1; diff --git a/pbx/pbx_config.c b/pbx/pbx_config.c index d999f3cd4925c8f9656e7334fae7894219567f41..7cd0fd5ee20c102b21970309560cb4ce82bc5290 100644 --- a/pbx/pbx_config.c +++ b/pbx/pbx_config.c @@ -1576,7 +1576,7 @@ static void pbx_load_users(void) } if (!ast_strlen_zero(iface)) { /* Add hint */ - ast_add_extension2(con, 0, cat, -1, NULL, NULL, iface, strdup(""), ast_free, registrar); + ast_add_extension2(con, 0, cat, -1, NULL, NULL, iface, NULL, NULL, registrar); /* If voicemail, use "stdexten" else use plain old dial */ if (hasvoicemail) { snprintf(tmp, sizeof(tmp), "stdexten|%s|${HINT}", cat); diff --git a/res/res_features.c b/res/res_features.c index 20ea18d36a83ab033144e0f0d643d4b69dbff96a..1aba2c199fc97306033fdc72b3bc0c34c0eb718d 100644 --- a/res/res_features.c +++ b/res/res_features.c @@ -2285,7 +2285,7 @@ static int load_config(void) ast_log(LOG_ERROR, "Parking context '%s' does not exist and unable to create\n", parking_con); return -1; } - res = ast_add_extension2(con, 1, ast_parking_ext(), 1, NULL, NULL, parkcall, strdup(""), ast_free, registrar); + res = ast_add_extension2(con, 1, ast_parking_ext(), 1, NULL, NULL, parkcall, NULL, NULL, registrar); if (parkaddhints) park_add_hints(parking_con, parking_start, parking_stop); if (!res)