X-Git-Url: https://git.exim.org/exim.git/blobdiff_plain/4fab92fbc2b63bac2d89c1dae69fa1845cb640b7..d5c0d8c9374623620844d539d4810da63e9abca1:/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