Navigation Menu

Skip to content

Commit

Permalink
Fix a memory leak with groonga-normalizer-mysql
Browse files Browse the repository at this point in the history
If normalizers/mysql is already registered, registering it again
causes a memory leak.
  • Loading branch information
kou committed Jun 9, 2013
1 parent a093d7b commit 4011f34
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion ha_mroonga.cpp
Expand Up @@ -3920,7 +3920,15 @@ int ha_mroonga::ensure_database_create(const char *name)
pthread_mutex_unlock(&mrn_db_mutex);
grn_ctx_use(ctx, db);
#ifdef WITH_GROONGA_NORMALIZER_MYSQL
grn_plugin_register(ctx, GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME);
{
grn_obj *mysql_normalizer;
mysql_normalizer = grn_ctx_get(ctx, "NormalizerMySQLGeneralCI", -1);
if (mysql_normalizer) {
grn_obj_unlink(ctx, mysql_normalizer);
} else {
grn_plugin_register(ctx, GROONGA_NORMALIZER_MYSQL_PLUGIN_NAME);
}
}
#endif

DBUG_RETURN(error);
Expand Down

0 comments on commit 4011f34

Please sign in to comment.