aboutsummaryrefslogtreecommitdiff
path: root/nx-X11
diff options
context:
space:
mode:
authorUlrich Sibiller <uli42@gmx.de>2020-10-03 01:57:58 +0200
committerUlrich Sibiller <uli42@gmx.de>2021-06-20 20:12:50 +0200
commitd32b4f5b1a55e0bbca79701d2b89bede331fed75 (patch)
treec1933b004c2b907c05b0b27420f73f470fdf8b93 /nx-X11
parent278ebeb70d7183ba62c6bbbcfce08ff08e205117 (diff)
downloadnx-libs-d32b4f5b1a55e0bbca79701d2b89bede331fed75.tar.gz
nx-libs-d32b4f5b1a55e0bbca79701d2b89bede331fed75.tar.bz2
nx-libs-d32b4f5b1a55e0bbca79701d2b89bede331fed75.zip
Clipboard.c: fix memleaks in DEBUG mode
Diffstat (limited to 'nx-X11')
-rw-r--r--nx-X11/programs/Xserver/hw/nxagent/Clipboard.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
index 202eb1baa..74ed61d7f 100644
--- a/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
+++ b/nx-X11/programs/Xserver/hw/nxagent/Clipboard.c
@@ -2136,10 +2136,16 @@ int nxagentConvertSelection(ClientPtr client, WindowPtr pWin, Atom selection,
* by a real time. The reply also contains time "0" which is
* unexpected (for me) */
#ifdef DEBUG
+ char *t = XGetAtomName(nxagentDisplay, remTarget);
+ char *p = XGetAtomName(nxagentDisplay, remProperty);
+ char *s = XGetAtomName(nxagentDisplay, remSelection);
fprintf(stderr, "%s: Sending XConvertSelection to real X server: requestor [0x%x] target [%ld][%s] property [%ld][%s] selection [%ld][%s] time [0][CurrentTime]\n", __func__,
- serverWindow, remTarget, XGetAtomName(nxagentDisplay, remTarget),
- remProperty, XGetAtomName(nxagentDisplay, remProperty),
- remSelection, XGetAtomName(nxagentDisplay, remSelection));
+ serverWindow, remTarget, validateString(t),
+ remProperty, validateString(p),
+ remSelection, validateString(s));
+ SAFE_XFree(t);
+ SAFE_XFree(p);
+ SAFE_XFree(s);
#endif
XConvertSelection(nxagentDisplay, remSelection, remTarget, remProperty, serverWindow, CurrentTime);
@@ -2193,8 +2199,10 @@ XlibAtom translateLocalToRemoteSelection(Atom local)
}
#ifdef DEBUG
+ char *r = XGetAtomName(nxagentDisplay, remote);
fprintf(stderr, "%s: mapping local to remote selection: [%d][%s] -> [%ld] [%s]\n", __func__,
- local, NameForAtom(local), remote, XGetAtomName(nxagentDisplay, remote));
+ local, NameForAtom(local), remote, validateString(r));
+ SAFE_XFree(r);
#endif
return remote;
@@ -2235,8 +2243,10 @@ XlibAtom translateLocalToRemoteTarget(Atom local)
}
#ifdef DEBUG
+ char *r = XGetAtomName(nxagentDisplay, remote);
fprintf(stderr, "%s: mapping local to remote target: [%d][%s] -> [%ld] [%s]\n", __func__,
- local, NameForAtom(local), remote, XGetAtomName(nxagentDisplay, remote));
+ local, NameForAtom(local), remote, validateString(r));
+ SAFE_XFree(r);
#endif
return remote;