[prev in list] [next in list] [prev in thread] [next in thread] 

List:       nedit-develop
Subject:    Re: two small bugs!
From:       Tony Balinski <ajbj () free ! fr>
Date:       2007-07-02 21:57:25
Message-ID: 1183417030.468982c661c90 () imp ! free ! fr
[Download RAW message or body]

Quoting Bert Wesarg <wesarg@informatik.uni-halle.de>:

> Hello,
>
> I think I found two small bugs/leaks/... whatever:

You did - well spotted!

> I) window.c:
>
> function deleteDocument() has obviously a NULL pointer dereference:
>
> static void deleteDocument(WindowInfo *window)
> {
>     if (NULL != window) {
>         return;
This was a mistaken change of test - it originally read "if (!window)"
and was changed to a more explicit test, but with the wrong operator.
I've updated this to "if (NULL == window)"

> II) window.c:
>
> function MoveDocumentDialog() has a memory leak for the case (!nList):
>
>     /* stop here if there's no other window to move to */
>     if (!nList) {
>         XtFree((char *)list);
>         return;
>     }
>
> it misses the previously allocated shellWinList
I've added "XtFree((char *)shellWinList);" just before the return.

Thanks,

Tony
-- 
NEdit Develop mailing list - Develop@nedit.org
http://www.nedit.org/mailman/listinfo/develop
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic