[3110] in Athena Bugs
zaway memory leak
daemon@ATHENA.MIT.EDU (Barr3y Jaspan)
Wed Sep 6 14:58:10 1989
Date: Wed, 6 Sep 89 14:57:48 -0400
From: Barr3y Jaspan <bjaspan@ATHENA.MIT.EDU>
To: bugs@ATHENA.MIT.EDU
zaway has a few cases in which a response it not sent (such as if the
message is from ZGetSender() or starts with "Automated Reply:".)
However, it never frees the notices it receives in those cases. Below
is a patch to fix the problem. Note that I also *CHANGED* the
behavior of zaway so that it does not respond to PINGs, since a) there
really is no good reason to, and b) it is very confusing to people who
display PINGs (at least, it is very confusing to me.)
Note also that the same bug used to exist in zwgc before I noticed it
last term.. perhaps other zephyr clients should be checked.
Barr3y
------------- snip snip --------------
102,105c102,109
< if (!strcmp(notice.z_sender,ZGetSender()))
< continue;
< if (!strcmp(notice.z_message,"Automated reply:"))
< continue;
---
>
> if (strcmp(notice.z_sender,ZGetSender()) == 0 ||
> strcmp(notice.z_opcode,"PING") == 0 ||
> strcmp(notice.z_message,"Automated reply:") == 0) {
> ZFreeNotice(¬ice);
> continue;
> }
>
107,108c111,113
< if (!(ptr = find_message(¬ice,fp)))
< continue;
---
> if (!(ptr = find_message(¬ice,fp))) {
> ZFreeNotice(¬ice);
> continue; }
127a133,134
> free(ptr);
> ZFreeNotice(¬ice);