diff options
Diffstat (limited to 'xkbpath.c')
-rw-r--r-- | xkbpath.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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)); |