From: Mark Michelson Date: Tue, 20 Mar 2012 20:40:46 +0000 (+0000) Subject: Fix another "Possible programming error" bug. X-Git-Tag: certified/1.8.11-cert1~3^2~14 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c19a4eeb1b7a3e5bc8896ba17322ebcfdcad797;p=thirdparty%2Fasterisk.git Fix another "Possible programming error" bug. Similar to the previous commit, don't pass a printf-generated string to ast_strlen_zero. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8-digiumphones@360035 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/pbx.c b/main/pbx.c index 5f6c37b07e..c3880db031 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -4452,17 +4452,18 @@ static int extension_presence_state_helper(struct ast_exten *e, char **subtype, { struct ast_str *hint_app = ast_str_thread_get(&extensionstate_buf, 32); char *presence_provider; + const char *app; if (!e || !hint_app) { return -1; } - ast_str_set(&hint_app, 0, "%s", ast_get_extension_app(e)); - presence_provider = parse_hint_presence(hint_app); - - if (ast_strlen_zero(presence_provider)) { + app = ast_get_extension_app(e); + if (ast_strlen_zero(app)) { return -1; } + ast_str_set(&hint_app, 0, "%s", app); + presence_provider = parse_hint_presence(hint_app); return ast_presence_state(presence_provider, subtype, message); }