summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/asterisk/config.h3
-rw-r--r--main/config.c5
2 files changed, 8 insertions, 0 deletions
diff --git a/include/asterisk/config.h b/include/asterisk/config.h
index 56401bf46..932404d14 100644
--- a/include/asterisk/config.h
+++ b/include/asterisk/config.h
@@ -358,6 +358,9 @@ int ast_realtime_require_field(const char *family, ...) attribute_sentinel;
* is thus stored inside a traditional ast_config structure rather than
* just returning a linked list of variables.
*
+ * \return An ast_config with one or more results
+ * \retval NULL Error or no results returned
+ *
* \note You should use the constant SENTINEL to terminate arguments, in
* order to preserve cross-platform compatibility.
*/
diff --git a/main/config.c b/main/config.c
index e432de33d..6381a53f5 100644
--- a/main/config.c
+++ b/main/config.c
@@ -2446,6 +2446,11 @@ struct ast_config *ast_load_realtime_multientry(const char *family, ...)
for (i = 1; ; i++) {
if ((eng = find_engine(family, i, db, sizeof(db), table, sizeof(table)))) {
if (eng->realtime_multi_func && (res = eng->realtime_multi_func(db, table, ap))) {
+ /* If we were returned an empty cfg, destroy it and return NULL */
+ if (!res->root) {
+ ast_config_destroy(res);
+ res = NULL;
+ }
break;
}
} else {