diff -Naur xorg-server-1.17.1/dix/grabs.c xorg-server-1.17.1_mod/dix/grabs.c --- xorg-server-1.17.1/dix/grabs.c 2015-01-18 05:12:52.000000000 +0530 +++ xorg-server-1.17.1_mod/dix/grabs.c 2015-05-29 19:40:51.000000000 +0530 @@ -594,10 +594,10 @@ i++; if (!i) return TRUE; - deletes = malloc(i * sizeof(GrabPtr)); - adds = malloc(i * sizeof(GrabPtr)); - updates = malloc(i * sizeof(Mask **)); - details = malloc(i * sizeof(Mask *)); + deletes = Xmalloc(i * sizeof(GrabPtr)); + adds = Xmalloc(i * sizeof(GrabPtr)); + updates = Xmalloc(i * sizeof(Mask **)); + details = Xmalloc(i * sizeof(Mask *)); if (!deletes || !adds || !updates || !details) { free(details); free(updates); diff -Naur xorg-server-1.17.1/include/os.h xorg-server-1.17.1_mod/include/os.h --- xorg-server-1.17.1/include/os.h 2015-01-18 05:12:52.000000000 +0530 +++ xorg-server-1.17.1_mod/include/os.h 2015-05-29 19:40:15.000000000 +0530 @@ -72,6 +72,7 @@ #define xnfcalloc(_num, _size) XNFcalloc((unsigned long)(_num)*(unsigned long)(_size)) #define xnfrealloc(ptr, size) XNFrealloc((void *)(ptr), (unsigned long)(size)) +#define xmalloc(size) Xmalloc((unsigned long)(size)) #define xstrdup(s) Xstrdup(s) #define xnfstrdup(s) XNFstrdup(s) #endif @@ -210,6 +211,9 @@ int *authlen, void *client); +extern _X_EXPORT void * +Xmalloc(unsigned long /*amount */ ); + /* * This function malloc(3)s buffer, terminating the server if there is not * enough memory. diff -Naur xorg-server-1.17.1/os/utils.c xorg-server-1.17.1_mod/os/utils.c --- xorg-server-1.17.1/os/utils.c 2014-11-17 11:21:18.000000000 +0530 +++ xorg-server-1.17.1_mod/os/utils.c 2015-05-29 19:43:08.000000000 +0530 @@ -1129,6 +1129,15 @@ } void * +Xmalloc(unsigned long amount) +{ + OsBlockSIGIO(); + void *mem = malloc(amount); + OsReleaseSIGIO(); + return mem; +} + +void * XNFcalloc(unsigned long amount) { void *ret = calloc(1, amount);