Skip to content

Commit dd36348

Browse files
committed
Bug#36532102 Memory leak in NdbDictionaryImpl.cpp
A pointer variable named "otherName" is defined and allocated a block of dynamic memory using the new operator. When the subsequent if statement evaluates to true, the program returns without executing the release operation for the dynamically allocated memory pointed to by "otherName", thus causing a memory leak. Fix by releasing allocated memory before returning. Change-Id: I61597c0f5c70fde84f2f483c9c95d64a2b1cf169
1 parent 1e96431 commit dd36348

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

storage/ndb/src/ndbapi/NdbDictionaryImpl.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6326,6 +6326,7 @@ int NdbDictInterface::unpackOldListTables(NdbDictionary::Dictionary::List &list,
63266326
}
63276327
memcpy(otherName, &data[pos], n << 2);
63286328
if (!(objectName = BaseString(otherName))) {
6329+
delete[] otherName;
63296330
m_error.code = 4000;
63306331
return -1;
63316332
}

0 commit comments

Comments
 (0)