-/* $OpenBSD: cmd-load-buffer.c,v 1.52 2018/07/11 08:29:21 nicm Exp $ */
+/* $OpenBSD: cmd-load-buffer.c,v 1.53 2018/07/31 13:06:44 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
error = server_set_stdin_callback(c, cmd_load_buffer_callback,
cdata, &cause);
if (error != 0) {
- cmdq_error(item, "%s: %s", path, cause);
+ cmdq_error(item, "-: %s", cause);
free(cause);
return (CMD_RETURN_ERROR);
}
}
file = server_client_get_path(c, path);
+ free(path);
+
f = fopen(file, "rb");
if (f == NULL) {
cmdq_error(item, "%s: %s", file, strerror(errno));
-/* $OpenBSD: cmd-save-buffer.c,v 1.44 2018/07/11 08:29:21 nicm Exp $ */
+/* $OpenBSD: cmd-save-buffer.c,v 1.45 2018/07/31 13:06:44 nicm Exp $ */
/*
* Copyright (c) 2009 Tiago Cunha <me@tiagocunha.org>
flags = "ab";
file = server_client_get_path(c, path);
+ free(path);
+
f = fopen(file, flags);
if (f == NULL) {
cmdq_error(item, "%s: %s", file, strerror(errno));
fclose(f);
free(file);
- free(path);
return (CMD_RETURN_NORMAL);