libX11 Xrm.c -- Fix a mutex reference-counting bug

Jeremy C. Reed reed at reedmedia.net
Thu Jul 26 16:55:26 PDT 2007


Okay to commit the following for libX11?

This is from NetBSD's xsrc (and pkgsrc):
Fix a mutex reference-counting bug.

Add a NetBSD xsrc patch to unlock mutexes before destroying them.

--- src/Xrm.c.orig	2006-09-25 12:57:47.000000000 +0200
+++ src/Xrm.c
@@ -808,6 +808,7 @@ void XrmCombineDatabase(
 	    }
 	}
 	(from->methods->destroy)(from->mbstate);
+	_XUnlockMutex(&from->linfo);
 	_XFreeMutex(&from->linfo);
 	Xfree((char *)from);
 	_XUnlockMutex(&(*into)->linfo);
@@ -2656,6 +2657,7 @@ void XrmDestroyDatabase(
 	    else
 		DestroyNTable(table);
 	}
+	_XUnlockMutex(&db->linfo);
 	_XFreeMutex(&db->linfo);
 	(*db->methods->destroy)(db->mbstate);
 	Xfree((char *)db);

  Jeremy C. Reed




More information about the xorg mailing list