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

Fix memory leaks while handling messages 6, 8 and 24 #198

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/libais/ais_py.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -782,6 +782,7 @@ ais6_to_pydict(const char *nmea_payload, const size_t pad) {
msg.dac,
msg.fi,
AIS_STATUS_STRINGS[status]);
Py_DECREF(dict);
return nullptr;
}

Expand Down Expand Up @@ -2119,6 +2120,7 @@ ais8_to_pydict(const char *nmea_payload, const size_t pad) {
if (status != AIS_OK) {
PyErr_Format(ais_py_exception, "Ais8: %s",
AIS_STATUS_STRINGS[status]);
Py_DECREF(dict);
return nullptr;
}

Expand Down Expand Up @@ -2634,6 +2636,7 @@ ais24_to_pydict(const char *nmea_payload, const size_t pad) {
default:
// status = AIS_ERR_BAD_MSG_CONTENT;
// TODO(schwehr): setup python exception
Py_DECREF(dict);
return nullptr;
}

Expand Down