]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
MODAPP-407
authorMathieu Rene <mrene@avgs.ca>
Tue, 9 Mar 2010 19:16:10 +0000 (19:16 +0000)
committerMathieu Rene <mrene@avgs.ca>
Tue, 9 Mar 2010 19:16:10 +0000 (19:16 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@16957 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_limit/mod_limit.c

index 95c8b750a722af5dce267e5b5bcc34e3e9bd924f..44d900c8bf7987f12db824a4ebd99b9dacf850f5 100644 (file)
@@ -637,8 +637,11 @@ SWITCH_STANDARD_API(group_api_function)
 
                limit_execute_sql_callback(NULL, sql, group_callback, &cbt);
                switch_safe_free(sql);
-
-               *(buf + (strlen(buf) - 1)) = '\0';
+       
+               if (!zstr(buf)) {
+                       *(buf + (strlen(buf) - 1)) = '\0';
+               }
+               
                stream->write_function(stream, "%s", buf);
 
                goto done;
@@ -1163,7 +1166,7 @@ SWITCH_STANDARD_APP(limit_hash_execute_function)
                switch_core_session_execute_application(session, app, app_arg);
                /* Only release the resource if we are still in CS_EXECUTE */
                if (switch_channel_get_state(switch_core_session_get_channel(session)) == CS_EXECUTE) {
-                       limit_hash_release(session, realm, id);                 
+                       limit_hash_release(session, realm, id); 
                }
        }
 }