]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Fix double-free in X selection code.
authorSimon Tatham <anakin@pobox.com>
Tue, 27 Jul 2004 15:20:37 +0000 (15:20 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 27 Jul 2004 15:20:37 +0000 (15:20 +0000)
[originally from svn r4367]

unix/pterm.c

index 8e2554d8fe9716eba0d0fa8407c6bcc1435dd95b..f23f07b7cf1c2af2fc70fe265a3e6386faaa0a0b 100644 (file)
@@ -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;