Assorted memleak fixes. Found on Michael Stefaniuc smatch list.

diff --git a/dlls/x11drv/clipboard.c b/dlls/x11drv/clipboard.c
index ae76f3e..8e42bc9 100644
--- a/dlls/x11drv/clipboard.c
+++ b/dlls/x11drv/clipboard.c
@@ -1262,13 +1262,17 @@
     {
         /* Turn on the DDESHARE flag to enable shared 32 bit memory */
         hClipData = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, cBytes);
+        if (hClipData == 0) return NULL;
+
         if ((lpClipData = GlobalLock(hClipData)))
         {
             memcpy(lpClipData, lpdata, cBytes);
             GlobalUnlock(hClipData);
         }
-        else
+        else {
+            GlobalFree(hClipData);
             hClipData = 0;
+        }
     }
 
     return hClipData;
@@ -1296,6 +1300,7 @@
         cBytes = GlobalSize(lpData->hData32);
 
         hClipData = GlobalAlloc(GMEM_MOVEABLE | GMEM_DDESHARE, cBytes);
+        if (hClipData == 0) return NULL;
 
         if ((lpClipData = GlobalLock(hClipData)))
         {
@@ -1306,6 +1311,9 @@
 
             GlobalUnlock(lpData->hData32);
             GlobalUnlock(hClipData);
+        } else {
+            GlobalFree(hClipData);
+            hClipData = 0;
         }
     }
 
@@ -1324,7 +1332,7 @@
     UINT i, j;
     UINT size;
     LPWSTR uni_text;
-    LPSTR text, lpstr;
+    LPSTR text, lpstr = NULL;
 
     *lpBytes = 0; /* Assume return has zero bytes */
 
@@ -1333,14 +1341,14 @@
     size = WideCharToMultiByte(CP_UNIXCP, 0, uni_text, -1, NULL, 0, NULL, NULL);
 
     text = HeapAlloc(GetProcessHeap(), 0, size);
-    if (!text)
-       return None;
+    if (!text) goto done;
     WideCharToMultiByte(CP_UNIXCP, 0, uni_text, -1, text, size, NULL, NULL);
 
     /* remove carriage returns */
 
     lpstr = (char*)HeapAlloc( GetProcessHeap(), HEAP_ZERO_MEMORY, size-- );
-    if(lpstr == NULL) return None;
+    if(lpstr == NULL) goto done;
+
     for(i = 0,j = 0; i < size && text[i]; i++ )
     {
         if( text[i] == '\r' &&
@@ -1351,6 +1359,7 @@
 
     *lpBytes = j; /* Number of bytes in string */
 
+done:
     HeapFree(GetProcessHeap(), 0, text);
     GlobalUnlock(lpData->hData32);
 
diff --git a/dlls/x11drv/xrender.c b/dlls/x11drv/xrender.c
index d27751d..01f67b9 100644
--- a/dlls/x11drv/xrender.c
+++ b/dlls/x11drv/xrender.c
@@ -1065,13 +1065,13 @@
 
     if(flags & (ETO_CLIPPED | ETO_OPAQUE)) {
         if(!lprect) {
-	    if(flags & ETO_CLIPPED) return FALSE;
-	        GetTextExtentPointI(hdc, glyphs, count, &sz);
-		done_extents = TRUE;
-		rc.left = x;
-		rc.top = y;
-		rc.right = x + sz.cx;
-		rc.bottom = y + sz.cy;
+            if(flags & ETO_CLIPPED) goto done;
+            GetTextExtentPointI(hdc, glyphs, count, &sz);
+            done_extents = TRUE;
+            rc.left = x;
+            rc.top = y;
+            rc.right = x + sz.cx;
+            rc.bottom = y + sz.cy;
 	} else {
 	    rc = *lprect;
 	}
@@ -1115,7 +1115,7 @@
 
     if(count == 0) {
 	retv =  TRUE;
-        goto done;
+        goto done_unlock;
     }
 
     pt.x = x;
@@ -1539,7 +1539,7 @@
             strikeoutWidth = underlineWidth;
         } else {
             otm = HeapAlloc(GetProcessHeap(), 0, nMetricsSize);
-            if (!otm) goto done;
+            if (!otm) goto done_unlock;
 
             GetOutlineTextMetricsW(hdc, nMetricsSize, otm);
             underlinePos = otm->otmsUnderscorePosition;
@@ -1592,8 +1592,9 @@
 
     retv = TRUE;
 
-done:
+done_unlock:
     X11DRV_UnlockDIBSection( physDev, TRUE );
+done:
     if(glyphs != wstr) HeapFree(GetProcessHeap(), 0, (WORD*)glyphs);
     return retv;
 }