}
unlink(tmp_file);
free(tmp_file);
+ tmp_file = NULL;
}
static void pw_edit(void)
warn(NULL);
}
warnx(_("%s unchanged"), orig_file);
- unlink(tmp_file);
+
+ if (tmp_file)
+ unlink(tmp_file);
ulckpwdf();
exit(eval);
}
if (close_stream(tmp_fd) != 0)
err(EXIT_FAILURE, _("write error"));
tmp_fd = fopen(tmp_file, "r");
- if (!tmp_file)
+ if (!tmp_fd)
err(EXIT_FAILURE, _("cannot open %s"), tmp_file);
if (fstat(fileno(tmp_fd), &end))
pw_error(tmp_file, 1, 1);