aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xquartz/xpr/x-hook.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-12-08 11:23:34 +0000
committermarha <marha@users.sourceforge.net>2009-12-08 11:23:34 +0000
commit75d2bbcf0f39b9c85bc270728343f61dabebce2d (patch)
treecc3c92e0383bc1ed885d25290167c46b1f9edb15 /xorg-server/hw/xquartz/xpr/x-hook.c
parent3e1ba549192a68801232c28a9c12defb59531654 (diff)
downloadvcxsrv-75d2bbcf0f39b9c85bc270728343f61dabebce2d.tar.gz
vcxsrv-75d2bbcf0f39b9c85bc270728343f61dabebce2d.tar.bz2
vcxsrv-75d2bbcf0f39b9c85bc270728343f61dabebce2d.zip
Git update 8/12/2009
Diffstat (limited to 'xorg-server/hw/xquartz/xpr/x-hook.c')
-rw-r--r--xorg-server/hw/xquartz/xpr/x-hook.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/xorg-server/hw/xquartz/xpr/x-hook.c b/xorg-server/hw/xquartz/xpr/x-hook.c
index bb873bbfb..03e7f8553 100644
--- a/xorg-server/hw/xquartz/xpr/x-hook.c
+++ b/xorg-server/hw/xquartz/xpr/x-hook.c
@@ -34,6 +34,7 @@
#include "x-hook.h"
#include <stdlib.h>
#include <assert.h>
+#include "os.h"
#define CELL_NEW(f,d) X_PFX (list_prepend) ((x_list *) (f), (d))
#define CELL_FREE(c) X_PFX (list_free_1) (c)
@@ -79,9 +80,13 @@ X_PFX (hook_run) (x_list *lst, void *arg)
int length, i;
length = X_PFX (list_length) (lst);
- fun = alloca (sizeof (x_hook_function *) * length);
- data = alloca (sizeof (void *) * length);
+ fun = xalloc (sizeof (x_hook_function *) * length);
+ data = xalloc (sizeof (void *) * length);
+ if(!fun || !data) {
+ FatalError("Failed to allocate memory in %s\n", __func__);
+ }
+
for (i = 0, node = lst; node != NULL; node = node->next, i++)
{
cell = node->data;
@@ -93,6 +98,9 @@ X_PFX (hook_run) (x_list *lst, void *arg)
{
(*fun[i]) (arg, data[i]);
}
+
+ xfree(fun);
+ xfree(data);
}
X_EXTERN void