[Scummvm-git-logs] scummvm master -> 93af8e33e9b74c117db28d7005f65a4e7cc6cf96
digitall
noreply at scummvm.org
Tue Dec 5 22:56:29 UTC 2023
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
93af8e33e9 GLK: AGT: Correction To Previous Fix For Temporary Variable Pointer Usage
Commit: 93af8e33e9b74c117db28d7005f65a4e7cc6cf96
https://github.com/scummvm/scummvm/commit/93af8e33e9b74c117db28d7005f65a4e7cc6cf96
Author: D G Turner (digitall at scummvm.org)
Date: 2023-12-05T22:53:51Z
Commit Message:
GLK: AGT: Correction To Previous Fix For Temporary Variable Pointer Usage
The previous change corrected the compiler warning, but the resulting
allocated buffer was not passed out of the function. This will likely
result in a memory leak if this is not deallocated elsewhere, but this
is a better situation than a likely segfault from usage of a local
variable pointer out of scope.
Changed paths:
engines/glk/agt/exec.cpp
diff --git a/engines/glk/agt/exec.cpp b/engines/glk/agt/exec.cpp
index 2bd86dd0439..7d355be02db 100644
--- a/engines/glk/agt/exec.cpp
+++ b/engines/glk/agt/exec.cpp
@@ -1193,9 +1193,8 @@ void increment_turn(void) {
creatloop(i)
if (creature[i].location == loc + first_room && creature[i].hostile &&
creature[i].timethresh > 0) {
- parse_rec *tmpcreat = nullptr; /* Used for creature messages */
- make_parserec(i + first_creat, tmpcreat);
- curr_creat_rec = tmpcreat;
+ // FIXME: Need to deallocate curr_creat_rec before assignment to new object, to avoid memory leakage?
+ curr_creat_rec = make_parserec(i + first_creat, nullptr); /* Used for creature messages */
if (++creature[i].timecounter >= creature[i].timethresh) {
/* Creature attacks */
More information about the Scummvm-git-logs
mailing list