From a637349b324f2763d20956388e2dc5073bb50c60 Mon Sep 17 00:00:00 2001 From: Petr Baudis Date: Fri, 6 Jan 2006 17:08:38 +0100 Subject: [PATCH] Prevent complaining about leaking clipboard --- src/osdep/osdep.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/osdep/osdep.c b/src/osdep/osdep.c index 14710a7f..1503f84d 100644 --- a/src/osdep/osdep.c +++ b/src/osdep/osdep.c @@ -379,8 +379,9 @@ set_clipboard_text(unsigned char *data) if (str.source) done_string(&str); } - if (clipboard) mem_free(clipboard); - clipboard = stracpy(data); + /* Shouldn't complain about leaks. */ + if (clipboard) free(clipboard); + clipboard = strdup(data); } /* Set xterm-like term window's title. */