This is the mail archive of the cygwin-xfree@cygwin.com mailing list for the Cygwin XFree86 project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: [ANNOUNCEMENT] Server Test 91


Harold,

after submitting this patch I recognized a rare case memory leak in
winMultiWindowGetClassHint() if the memory allocation for "res_class" fails.
This is fixed by the appended small patch, which is based on the previous one.
(Hope the indention is right)

Ralf

------------------------------------------------------------------
$ diff -up winmultiwindowclass.c.orig  winmultiwindowclass.c
--- winmultiwindowclass.c.orig  2003-06-04 19:48:36.000000000 +0200
+++ winmultiwindowclass.c       2003-06-04 19:55:38.000000000 +0200
@@ -76,8 +76,11 @@ winMultiWindowGetClassHint (WindowPtr pW

     (*res_class) = malloc (len_class + 1);

-    if (!*res_class)
-      return 0;
+    if (!*res_class)
+      {
+        free(*res_name);
+        return 0;
+      }

     strcpy ((*res_class), ((char *)prop->data) + 1 + len_name);
------------------------------------------------------------------

>
> Ralf,
>
> Thanks.
>
> http://www.msu.edu/~huntharo/xwin/shadow/XWin-Test91-DEBUG.exe.bz2
>
> Harold
>
> Ralf Habacker wrote:
>
> > Harold Hunt wrote:
> >
> >
> >>5) winclass.c, winclass.h - Rename these files to
> >>winmultiwindowclass.c and winmultiwindowclass.h, respectively, since
> >>they are only used in MultiWindow mode.  Prefix the functions in these
> >>files with MultiWindow.  (Harold L Hunt II)
> >>
> >
> > The appended patch contains some function parameter checking to
> avoid segfaults
> > in case of invalid parameter values.
> >
> > It is based on the xwin-Test91 release.
> >




Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]