]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11422: [mod_java] Fix logging.
authorAndrey Volk <andywolk@gmail.com>
Sat, 29 Sep 2018 10:21:37 +0000 (13:21 +0300)
committerAndrey Volk <andywolk@gmail.com>
Sat, 29 Sep 2018 10:21:37 +0000 (13:21 +0300)
src/mod/languages/mod_java/freeswitch_java.cpp

index d8508e145caafc2d8ccc7bf49a417788e806c433..d71d212b45b3762f246d57cb4cbaf1e282f8947b 100644 (file)
@@ -14,7 +14,7 @@ SWITCH_DECLARE(void) setOriginateStateHandler(jobject stateHandler)
         if ( stateHandler != NULL && originate_state_handler != NULL ) {
                 const char* errorMessage = "Originate state handler is already registered";
                 jclass exceptionClass = env->FindClass("java/util/TooManyListenersException");
-                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, errorMessage);
+                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s", errorMessage);
                 env->ThrowNew(exceptionClass, errorMessage);
         } else if ( stateHandler == NULL && originate_state_handler != NULL ) {
                 env->DeleteGlobalRef(originate_state_handler);
@@ -24,7 +24,7 @@ SWITCH_DECLARE(void) setOriginateStateHandler(jobject stateHandler)
                 if ( originate_state_handler == NULL ) {
                         const char* errorMessage = "Unable to create global reference for state handler";
                         jclass exceptionClass = env->FindClass("java/lang/OutOfMemoryError");
-                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, errorMessage);
+                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "%s", errorMessage);
                         env->ThrowNew(exceptionClass, errorMessage);
                 }
         }