From: Chong Yidong Date: Wed, 3 Dec 2008 04:34:06 +0000 (+0000) Subject: (Fx_get_cut_buffer_internal): Fix memory leak. X-Git-Tag: emacs-pretest-23.0.90~1333 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=722b3ac972026284d526c1fd8029115006e5f771;p=emacs.git (Fx_get_cut_buffer_internal): Fix memory leak. --- diff --git a/src/xselect.c b/src/xselect.c index 7573be894d8..ce106f3ddac 100644 --- a/src/xselect.c +++ b/src/xselect.c @@ -2392,9 +2392,16 @@ DEFUN ("x-get-cut-buffer-internal", Fx_get_cut_buffer_internal, x_get_window_property (display, window, buffer_atom, &data, &bytes, &type, &format, &size, 0); - if (!data || !format) + + if (!data) return Qnil; + if (!format) + { + xfree (data); + return Qnil; + } + if (format != 8 || type != XA_STRING) signal_error ("Cut buffer doesn't contain 8-bit data", list2 (x_atom_to_symbol (display, type),