It was not documented what the return value should be when no entries
were returned with the multientry realtime callback. This change forces
consistent behavior even if the backends return an empty ast_config.
Review: https://reviewboard.asterisk.org/r/1521/
........
Merged revisions 342223 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 342224 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@342225
65c4cc65-6c06-0410-ace0-
fbb531ad65f3
* 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.
*/
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 {