changeset 100157:a0a1363582ff

Fix last fix.
author Chong Yidong <cyd@stupidchicken.com>
date Wed, 03 Dec 2008 04:37:29 +0000
parents a2ea34e75036
children 19e63b683632
files src/xselect.c
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/xselect.c	Wed Dec 03 04:37:24 2008 +0000
+++ b/src/xselect.c	Wed Dec 03 04:37:29 2008 +0000
@@ -2369,7 +2369,7 @@
 {
   Window window;
   Atom buffer_atom;
-  unsigned char *data;
+  unsigned char *data = NULL;
   int bytes;
   Atom type;
   int format;
@@ -2393,12 +2393,10 @@
   x_get_window_property (display, window, buffer_atom, &data, &bytes,
 			 &type, &format, &size, 0);
 
-  if (!data)
-    return Qnil;
-
-  if (!format)
+  if (!data || !format)
     {
-      xfree (data);
+      if (data)
+	xfree (data);
       return Qnil;
     }