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

Error in SOCmnList.cpp #5

Open
Eta76 opened this issue Dec 31, 2021 · 3 comments
Open

Error in SOCmnList.cpp #5

Eta76 opened this issue Dec 31, 2021 · 3 comments

Comments

@Eta76
Copy link

Eta76 commented Dec 31, 2021

Line 720 of SOCmnList.cpp should proabably say:
SOCMN_FREE_OBJECT_C(m_info, (SOCmnListInfoMap*));

Haven't looked into the MACRO, but they could be all deleting the same pointer. Making line 719 and 720 not do anything

Source: OPC-Classic-SDK-main\development\core\src\SOCmn\SOCmnList.cpp
BOOL SOCmnListHeader::create(
IN OPTIONAL SOCmnListConfig* creationConfig)
{
if (isInit())
{
return FALSE;
}
if (isList())
{
if ((m_type & SOCMNLIST_TYPE_INFO_FULL_LIST) != 0)
{
SOCMN_FREE_OBJECT_C(m_info, (SOCmnListInfoFullList*));
}
else
{
SOCMN_FREE_OBJECT_C(m_info, (SOCmnListInfoSimpleList*));
}
}
else if (isMap())
{
SOCMN_FREE_OBJECT_C(m_info, (SOCmnListInfoMap*));
}
else
{
// something went wrong and the old type can not determined
SOCMN_FREE_OBJECT_C(m_info, (SOCmnListInfoFullList*));
SOCMN_FREE_OBJECT_C(m_info, (SOCmnListInfoSimpleList*));
SOCMN_FREE_OBJECT_C(m_info, (SOCmnListInfoSimpleList*)); <===== Line 720
}

@FischerSeb
Copy link
Contributor

You are right. Can you please create a PR for this.

@mkentie
Copy link

mkentie commented Jan 17, 2022

I've created a pull request (I'm ETA76's coworker).

@Eta76
Copy link
Author

Eta76 commented Jan 17, 2022

@FischerSeb So this macro is not meant to be used for the currently allocated type? I suspected that you possibly needed to call the correct macro, knowing that is m_info contains a map or list. (isMap(), isList())

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

3 participants