diff options
author | marha <marha@users.sourceforge.net> | 2009-12-10 07:43:34 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-12-10 07:43:34 +0000 |
commit | 0540eb5a1f795c0f5265d244ec979b8ddfcf3acb (patch) | |
tree | 06c5c3f4394f2d6d48c95ed1bfbab3a44e9996cc /xorg-server/hw/xquartz/xpr/x-hook.c | |
parent | 5c72c54bc068bf12007dc15b353b1b2795e9aaf5 (diff) | |
parent | 75d2bbcf0f39b9c85bc270728343f61dabebce2d (diff) | |
download | vcxsrv-0540eb5a1f795c0f5265d244ec979b8ddfcf3acb.tar.gz vcxsrv-0540eb5a1f795c0f5265d244ec979b8ddfcf3acb.tar.bz2 vcxsrv-0540eb5a1f795c0f5265d244ec979b8ddfcf3acb.zip |
svn merge ^/trunk .
Diffstat (limited to 'xorg-server/hw/xquartz/xpr/x-hook.c')
-rw-r--r-- | xorg-server/hw/xquartz/xpr/x-hook.c | 12 |
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 |