Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory Leak/ Magic number in buildCustomDataTypes #570

Open
ccvca opened this issue Jul 21, 2023 · 3 comments
Open

Memory Leak/ Magic number in buildCustomDataTypes #570

ccvca opened this issue Jul 21, 2023 · 3 comments

Comments

@ccvca
Copy link
Member

ccvca commented Jul 21, 2023

This memory seems to be never freed. Also this 50 looks random.

m_dataTypeArray = (UA_DataTypeArray *)malloc(sizeof(UA_DataTypeArray) * 50);

==24634== 1,000 bytes in 1 blocks are definitely lost in loss record 631 of 646
==24634==    at 0x483950F: operator new[](unsigned long) (vg_replace_malloc.c:431)
==24634==    by 0x7C792A: Umati::OpcUa::OpcUaClient::readTypeDictionaries() (OpcUaClient.cpp:275)
==24634==    by 0x173904: main (TestResultType.cpp:21)
==24634== 
==24634== 1,600 bytes in 1 blocks are definitely lost in loss record 635 of 646
==24634==    at 0x483877F: malloc (vg_replace_malloc.c:307)
==24634==    by 0x7C60C4: Umati::OpcUa::OpcUaClient::buildCustomDataTypes() (OpcUaClient.cpp:144)
==24634==    by 0x173913: main (TestResultType.cpp:22)
==24634== 
==24634== 2,720 (32 direct, 2,688 indirect) bytes in 1 blocks are definitely lost in loss record 641 of 646
==24634==    at 0x4838DEF: operator new(unsigned long) (vg_replace_malloc.c:342)
==24634==    by 0x7C7574: Umati::OpcUa::OpcUaClient::buildCustomDataTypes() (OpcUaClient.cpp:267)
==24634==    by 0x173913: main (TestResultType.cpp:22)

PS: TestResultType is just a minimal application for debugging.

@Kantiran91
Copy link
Member

@ccvca Do you create an new Branch?

@ccvca
Copy link
Member Author

ccvca commented Jul 21, 2023

No, it's just some local isolated testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants