From d1929fa48a10b01ccf2f251a4a7263569ba15a68 Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 27 Jul 2004 15:20:37 +0000 Subject: [PATCH] Fix double-free in X selection code. git-svn-id: svn://svn.tartarus.org/sgt/putty@4367 cda61777-01e9-0310-a592-d414129be87e --- unix/pterm.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/unix/pterm.c b/unix/pterm.c index 8e2554d8..f23f07b7 100644 --- a/unix/pterm.c +++ b/unix/pterm.c @@ -1424,7 +1424,10 @@ void write_clip(void *frontend, wchar_t * data, int len, int must_deselect) memcpy(inst->pasteout_data_ctext, tp.value, tp.nitems); inst->pasteout_data_ctext_len = tp.nitems; XFree(tp.value); - } + } else { + inst->pasteout_data_ctext = NULL; + inst->pasteout_data_ctext_len = 0; + } } else { inst->pasteout_data_utf8 = NULL; inst->pasteout_data_utf8_len = 0; -- 2.11.0