diff options
-rw-r--r-- | dix/registry.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/dix/registry.c b/dix/registry.c index 4c74267f2..bf0a1dd0f 100644 --- a/dix/registry.c +++ b/dix/registry.c @@ -70,8 +70,14 @@ double_size(void *p, unsigned n, unsigned size) s = 0; n = f = BASE_SIZE * size; } + { + char * newptr = realloc(*ptr, n); + if (!newptr) { + free(*ptr); + } + *ptr = newptr; + } - *ptr = realloc(*ptr, n); if (!*ptr) { dixResetRegistry(); return FALSE; |