I found two memory leaks in the DragBS code.
The first is in read_atom_pairs and seems to be
due to confusion between the variables 'prop'
and 'pairs'.  The fix below takes the easy way
out; a better fix might be to collapse the two
variables into one.  The second one is in 
read_targets_table.  It looks like a simple 
oversight in failing to free a pointer at
function exit.  The following patch fixes
both leaks.

- Steve

*** lesstif-0.91.3/lib/Xm/DragBS.c.orig Sun Apr 30 18:38:22 2000
--- lesstif-0.91.3/lib/Xm/DragBS.c      Sun Jul  9 00:40:23 2000
***************
*** 508,513 ****
--- 508,514 ----
                      __FILE__, __LINE__));
  
        gotit = True;
+       prop = (unsigned char *)pairs;
      }
  
      end_protection(display);
***************
*** 1133,1138 ****
--- 1134,1144 ----
  
      DEBUGOUT(XdbDebug0(__FILE__, NULL, "%s:read_targets_table(%d) - True %p\n",
                      __FILE__, __LINE__, tbl));
+ 
+     if (targets)
+     {
+         XFree((XPointer)targets);
+     }
  
      return True;
  }




--== Sent via Deja.com http://www.deja.com/ ==--
Before you buy.

Reply via email to