BUG: https://bugzilla.samba.org/show_bug.cgi?id=13069
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit
4800ed3595513ce1e2f4edee36c35daafc63a3d5)
break;
}
if (errno != ERANGE) {
+ int saved_errno = errno;
SAFE_FREE(s);
+ errno = saved_errno;
break;
}
allocated *= 2;
}
wd = getwd(s);
if (wd == NULL) {
+ int saved_errno = errno;
SAFE_FREE(s);
+ errno = saved_errno;
}
return wd;
#endif