mirror of
https://github.com/nginx/nginx.git
synced 2025-06-09 19:12:47 +08:00
preserve errno while ngx_free()
This commit is contained in:
parent
d1e9567425
commit
7e4e5e165f
@ -20,6 +20,7 @@ ngx_open_file(u_char *name, u_long mode, u_long create, u_long access)
|
|||||||
{
|
{
|
||||||
u_short *u;
|
u_short *u;
|
||||||
ngx_fd_t fd;
|
ngx_fd_t fd;
|
||||||
|
ngx_err_t err;
|
||||||
u_short utf16[NGX_UTF16_BUFLEN];
|
u_short utf16[NGX_UTF16_BUFLEN];
|
||||||
|
|
||||||
u = ngx_utf8_to_utf16(utf16, name, NGX_UTF16_BUFLEN);
|
u = ngx_utf8_to_utf16(utf16, name, NGX_UTF16_BUFLEN);
|
||||||
@ -33,7 +34,9 @@ ngx_open_file(u_char *name, u_long mode, u_long create, u_long access)
|
|||||||
NULL, create, FILE_FLAG_BACKUP_SEMANTICS, NULL);
|
NULL, create, FILE_FLAG_BACKUP_SEMANTICS, NULL);
|
||||||
|
|
||||||
if (u != utf16) {
|
if (u != utf16) {
|
||||||
|
err = ngx_errno;
|
||||||
ngx_free(u);
|
ngx_free(u);
|
||||||
|
ngx_set_errno(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
return fd;
|
return fd;
|
||||||
|
Loading…
Reference in New Issue
Block a user