-
Notifications
You must be signed in to change notification settings - Fork 131
Open
Description
In the function _getdns_context_write_priv_file, after the failure of rename, fclose(f) will be called a second time. You should reset the f and fd variables.
else if (fclose(f))
_getdns_log(&context->log
, GETDNS_LOG_SYS_ANCHOR, GETDNS_LOG_ERR
, "Error closing temporary file \"%s\": %s (%p)\n"
, tmpfn, _getdns_fileerrnostr(), f);
else if (rename(tmpfn, path) < 0) {
f = NULL;
fd = -1;
_getdns_log(&context->log
, GETDNS_LOG_SYS_ANCHOR, GETDNS_LOG_ERR
, "Error renaming temporary file \"%s\" to \"%s\""
": %s\n", tmpfn, path, _getdns_fileerrnostr());
}
else {
context->can_write_appdata = PROP_ABLE;
return 1;
}
if (f)
(void) fclose(f);
else if (fd >= 0)
(void) close(fd);Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels