summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorOctavian Voicu <octavian.voicu@gmail.com>2009-08-06 12:09:47 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-08-06 12:09:47 (GMT)
commit0d57c5111236c06ace5b2759ddb4c63749a057da (patch)
treeae70008199bcfc4715010cb20eafecc31db20f6a /src
parent4a1785247d7e845b3d1c2023e43558f6a372581b (diff)
downloadQt-0d57c5111236c06ace5b2759ddb4c63749a057da.zip
Qt-0d57c5111236c06ace5b2759ddb4c63749a057da.tar.gz
Qt-0d57c5111236c06ace5b2759ddb4c63749a057da.tar.bz2
Fix crash in QX11Data::xdndHandleEnter when XGetWindowProperty fails
Task-number: 259143 Merge-request: 1119 Reviewed-by: Denis Dzyubenko <denis.dzyubenko@nokia.com>
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qdnd_x11.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/gui/kernel/qdnd_x11.cpp b/src/gui/kernel/qdnd_x11.cpp
index a15c20f..cc8cc03 100644
--- a/src/gui/kernel/qdnd_x11.cpp
+++ b/src/gui/kernel/qdnd_x11.cpp
@@ -825,15 +825,16 @@ void QX11Data::xdndHandleEnter(QWidget *, const XEvent * xe, bool /*passive*/)
Atom type = XNone;
int f;
unsigned long n, a;
- unsigned char *retval;
+ unsigned char *retval = 0;
XGetWindowProperty(X11->display, qt_xdnd_dragsource_xid, ATOM(XdndTypelist), 0,
qt_xdnd_max_type, False, XA_ATOM, &type, &f,&n,&a,&retval);
- Atom *data = (Atom *)retval;
- for (; j<qt_xdnd_max_type && j < (int)n; j++) {
- qt_xdnd_types[j] = data[j];
- }
- if (data)
+ if (retval) {
+ Atom *data = (Atom *)retval;
+ for (; j<qt_xdnd_max_type && j < (int)n; j++) {
+ qt_xdnd_types[j] = data[j];
+ }
XFree((uchar*)data);
+ }
} else {
// get the types from the message
int i;