Merge branch 'obsd-master'

This commit is contained in:
Thomas Adam 2024-10-12 12:01:09 +01:00
commit cb00e869ea
2 changed files with 10 additions and 0 deletions

View File

@ -121,6 +121,14 @@ cmd_source_file_done(struct client *c, const char *path, int error,
static void
cmd_source_file_add(struct cmd_source_file_data *cdata, const char *path)
{
char resolved[PATH_MAX];
if (realpath(path, resolved) == NULL) {
log_debug("%s: realpath(\"%s\") failed: %s", __func__,
path, strerror(errno));
} else
path = resolved;
log_debug("%s: %s", __func__, path);
cdata->files = xreallocarray(cdata->files, cdata->nfiles + 1,
sizeof *cdata->files);

View File

@ -240,6 +240,8 @@ paste_rename(const char *oldname, const char *newname, char **cause)
}
pb_new = paste_get_name(newname);
if (pb_new == pb)
return (0);
if (pb_new != NULL)
paste_free(pb_new);