xserver-multidpi/dbe
Alan Coopersmith 043c175865 Clean up memory better when GetVisualInfo fails in ProcDbeGetVisualInfo
Use calloc to initialize pScrVisInfo array so we don't have to check
which ones were already initialized when freeing them all.

On failure, set rc if necessary, and jump to code at end that already
frees all the necessary allocations and return rc.

Fixes parfait reported error:
Error: Memory leak (CWE 401)
   Memory leak of pointer 'pScrVisInfo' allocated with malloc((count * 16))
        at line 724 of dbe/dbe.c in function 'ProcDbeGetVisualInfo'.
          'pScrVisInfo' allocated at line 693 with malloc((count * 16)).
          pScrVisInfo leaks when rc != 0 at line 710
              and j >= i at line 716.

[ This bug was found by the Parfait 0.3.7 bug checking tool.
  For more information see http://labs.oracle.com/projects/parfait/ ]

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-05-02 20:38:16 -07:00
..
dbe.c Clean up memory better when GetVisualInfo fails in ProcDbeGetVisualInfo 2011-05-02 20:38:16 -07:00
dbestruct.h Change the devPrivates API to require dixRegisterPrivateKey 2010-06-05 19:23:03 -07:00
Makefile.am get rid of XFree86LOADER, XFree86Server, XFree86Module, and IN_MODULE 2006-07-18 18:17:38 -04:00
midbe.c miDbe window priv priv is pre-allocated, don't use dixSetPrivate (bug 28639) 2010-07-02 12:30:24 -04:00
midbe.h Change the devPrivates API to require dixRegisterPrivateKey 2010-06-05 19:23:03 -07:00
midbestr.h Delete unused miDbe screen private private datatype 2010-07-02 12:30:10 -04:00