X-Git-Url: https://git.exim.org/users/jgh/exim.git/blobdiff_plain/79de4f370f306869887e1714ff4ecef5bfc93fa5..4a5ee04fd186cb7d86a4f70821dacc55f8cce98d:/src/src/os.c diff --git a/src/src/os.c b/src/src/os.c index 47af038f7..ca24e8dd2 100644 --- a/src/src/os.c +++ b/src/src/os.c @@ -879,7 +879,7 @@ char * b = (char *)buffer; if (!size) size = PATH_MAX; if (!b && !(b = malloc(size))) return NULL; if (!(b = getcwd(b, size))) return NULL; -return realloc(b, strlen(b) + 1); +return buffer ? buffer : realloc(b, strlen(b) + 1); } #endif