Opened 2 years ago

Closed 2 years ago

#25 closed defect (fixed)

Potential memory leak

Reported by: abwillis Owned by: Andreas Schnellbacher
Priority: major Milestone: Unsorted
Component: Other Version: 1.18
Keywords: Cc:

Description

I ran cppcheck looking for possible uninitialized variables as I have seen crashes when doing a lot of scrolling. I did not find any but found a potential memory leak. I'll let you evaluate and decide if this is meaningful.

Index: src/gui/nepmdlib/nepmdlib.c
===================================================================
--- src/gui/nepmdlib/nepmdlib.c	(revision 2946)
+++ src/gui/nepmdlib/nepmdlib.c	(working copy)
@@ -1032,7 +1032,7 @@
          HCONFIG        hconfig;
 
          CHAR           szResult[ 20];
-         PMODEINFO      pmi = malloc( 1024);
+         PMODEINFO      pmi = NULL;
 
 FUNCENTER;
 
@@ -1076,6 +1076,8 @@
    } while (FALSE);
 
 FUNCEXITRC;
+if (pmi)
+  free( pmi);
 return _getRexxError( rc, pszBuffer, ulBuflen);
 }
 

Change History (6)

comment:1 Changed 2 years ago by Andreas Schnellbacher

Hy Andy, thanks for this.

have seen crashes when doing a lot of scrolling.

I've seen that the first time when trying out to get a TP R61i to work stable and experimenting with ACPI drivers. I think that happens on SMP machines only. I always had AMouse active, because I prefer scroll messages over keyboard messages, as SMouse does it.

With SMouse, I've never seen that. Maybe AMouse and GRADD are involved, together with SMP. AMouse behaves also strange at scrolling other windows, e.g. folders or Mozilla. That's why I think there still exists a bug in it.

Do you have AMouse installed?

Last edited 2 years ago by Andreas Schnellbacher (previous) (diff)

comment:2 Changed 2 years ago by abwillis

I used to use amouse but it has been many years ago now, once I started using Thinkpads I found the amouse driver did not work well with the Trackpoints so the crashes were with smouse.

comment:3 Changed 2 years ago by Andreas Schnellbacher

With SMouse, I had no problems like this (so far).

comment:4 Changed 2 years ago by Andreas Schnellbacher

In the meantime I remember that I'd dropped investigating the cause for scroll problems, when I found out that it behaves with the original EPM the same.

You can easily test this without uninstall by using the "Standard EPM" program object of NEPMD. nepmdlib.dll should not be loaded in that case, it's been loaded dynamically. (Having the original sources would be a huge improvement, not only for bugs like this.)

comment:5 Changed 2 years ago by Andreas Schnellbacher

Owner: set to Andreas Schnellbacher
Status: newaccepted
Version: 1.161.18

I've just checked that in: r2949. (Even I understand that there was a leak.) Thanks again.

Last edited 2 years ago by Andreas Schnellbacher (previous) (diff)

comment:6 Changed 2 years ago by Andreas Schnellbacher

Resolution: fixed
Status: acceptedclosed
Note: See TracTickets for help on using tickets.