ximcp: don't leak window if XGetAtomName() fails

Found by Oracle Parfait 13.3 static analyzer:
   X Resource Leak [X-resource-leak]:
      Leaked X Resource window
        at line 306 of imDefIm.c in function '_XimPreConnectionIM'.
          window initialized at line 300 with XCreateSimpleWindow

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Part-of: <https://gitlab.freedesktop.org/xorg/lib/libx11/-/merge_requests/269>
This commit is contained in:
Alan Coopersmith 2024-10-26 11:02:42 -07:00
parent df1f1a47f9
commit 41bc1a9dbe

View file

@ -303,7 +303,7 @@ _XimPreConnectionIM(
/* server name check */
if( !(str = XGetAtomName( display, selection )) )
return False;
goto Error;
if(!_XimCheckServerName(im, str)) {
XFree( (XPointer)str );
goto Error;