summaryrefslogtreecommitdiff
path: root/src/w16select.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/w16select.c')
-rw-r--r--src/w16select.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/w16select.c b/src/w16select.c
index 2a2b05f72e5..9498d7adfe8 100644
--- a/src/w16select.c
+++ b/src/w16select.c
@@ -500,6 +500,9 @@ DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_dat
BLOCK_INPUT;
+ if (!open_clipboard ())
+ goto error;
+
nbytes = SBYTES (string);
src = SDATA (string);
@@ -515,6 +518,7 @@ DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_dat
will have to convert it to DOS CR-LF style. */
no_crlf_conversion = 0;
Vlast_coding_system_used = Qraw_text;
+ dst = NULL; /* so we don't try to free a random pointer */
}
else
{
@@ -541,9 +545,6 @@ DEFUN ("w16-set-clipboard-data", Fw16_set_clipboard_data, Sw16_set_clipboard_dat
src = dst;
}
- if (!open_clipboard ())
- goto error;
-
ok = empty_clipboard ()
&& ((put_status
= set_clipboard_data (CF_OEMTEXT, src, nbytes, no_crlf_conversion))
@@ -595,7 +596,7 @@ DEFUN ("w16-get-clipboard-data", Fw16_get_clipboard_data, Sw16_get_clipboard_dat
Lisp_Object frame;
{
unsigned data_size, truelen;
- unsigned char *htext;
+ unsigned char *htext = NULL;
Lisp_Object ret = Qnil;
int no_crlf_conversion, require_decoding = 0;