freeswitch plugin: Only disconnect when connected
[collectd.git] / src / freeswitch.c
index b59f7aa..dbf9d21 100644 (file)
@@ -524,7 +524,7 @@ static int fs_init (void)
 static int fs_shutdown (void)
 {
        DEBUG ("freeswitch plugin: disconnecting");
-       esl_disconnect(&esl_handle);
+       if (esl_handle.connected) esl_disconnect(&esl_handle);
        fs_command_free (fs_commands_g);
        fs_commands_g = NULL;
        return (0);