--- mariadb-5.5.40.orig/sql/sql_plugin.cc	2014-10-08 22:19:52.000000000 +0900
+++ mariadb-5.5.40/sql/sql_plugin.cc	2015-01-16 22:51:32.957073875 +0900
@@ -3916,8 +3916,8 @@
       we copy string values to a plugin's memroot.
     */
     if (mysqld_server_started &&
-        ((o->flags & (PLUGIN_VAR_STR | PLUGIN_VAR_NOCMDOPT |
-                       PLUGIN_VAR_MEMALLOC)) == PLUGIN_VAR_STR))
+        ((o->flags & (PLUGIN_VAR_NOCMDOPT | PLUGIN_VAR_MEMALLOC)) == 0) &&
+        ((o->flags & 0x000f) == PLUGIN_VAR_STR))
     {
       sysvar_str_t* str= (sysvar_str_t *)o;
       if (*str->value)