Skip to content

Commit ce9c940

Browse files
author
jonas oreland
committed
ndb - still memory leak in binlog code if using more than 128 columns...
1 parent 8e31a8c commit ce9c940

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

sql/ha_ndbcluster_binlog.cc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6299,8 +6299,8 @@ ndb_binlog_thread_handle_data_event(Ndb *ndb, NdbEventOperation *pOp,
62996299
MY_BITMAP b;
63006300
/* Potential buffer for the bitmap */
63016301
uint32 bitbuf[128 / (sizeof(uint32) * 8)];
6302-
bitmap_init(&b, n_fields <= sizeof(bitbuf) * 8 ? bitbuf : NULL,
6303-
n_fields, FALSE);
6302+
const bool own_buffer = n_fields <= sizeof(bitbuf) * 8;
6303+
bitmap_init(&b, own_buffer ? bitbuf : NULL, n_fields, FALSE);
63046304
bitmap_set_all(&b);
63056305

63066306
/*
@@ -6463,6 +6463,11 @@ ndb_binlog_thread_handle_data_event(Ndb *ndb, NdbEventOperation *pOp,
64636463
my_free(blobs_buffer[1], MYF(MY_ALLOW_ZERO_PTR));
64646464
}
64656465

6466+
if (!own_buffer)
6467+
{
6468+
bitmap_free(&b);
6469+
}
6470+
64666471
return 0;
64676472
}
64686473

0 commit comments

Comments
 (0)