summaryrefslogtreecommitdiff
path: root/xkbpath.c
diff options
context:
space:
mode:
Diffstat (limited to 'xkbpath.c')
-rw-r--r--xkbpath.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/xkbpath.c b/xkbpath.c
index 695c13e..b5405de 100644
--- a/xkbpath.c
+++ b/xkbpath.c
@@ -213,13 +213,16 @@ XkbAddDirectoryToPath(const char *dir)
}
if (nPathEntries >= szPath)
{
+ char **new;
szPath += PATH_CHUNK;
- includePath = (char **) realloc(includePath, szPath * sizeof(char *));
- if (includePath == NULL)
+ new = (char **) realloc(includePath, szPath * sizeof(char *));
+ if (new == NULL)
{
WSGO("Allocation failed (includePath)\n");
return False;
}
+ else
+ includePath = new;
}
includePath[nPathEntries] =
(char *) calloc(strlen(dir) + 1, sizeof(char));