Xinqi Bao's Git
projects
/
st.git
/ commitdiff
summary
|
log
|
commit
|
diff
|
tree
raw
|
patch
|
inline
| side by side (from parent 1:
7648697
)
clipcopy: no need to check for free(NULL), set to NULL after free
author
Hiltjo Posthuma <
[email protected]
>
Sat, 17 Mar 2018 12:48:10 +0000
(13:48 +0100)
committer
Hiltjo Posthuma <
[email protected]
>
Sat, 17 Mar 2018 12:48:10 +0000
(13:48 +0100)
x.c
patch
|
blob
|
history
diff --git
a/x.c
b/x.c
index
d0b26ac
..
12bc86b
100644
(file)
--- a/
x.c
+++ b/
x.c
@@
-245,8
+245,8
@@
clipcopy(const Arg *dummy)
{
Atom clipboard;
{
Atom clipboard;
- if (xsel.clipboard != NULL)
-
free(xsel.clipboard)
;
+ free(xsel.clipboard);
+
xsel.clipboard = NULL
;
if (xsel.primary != NULL) {
xsel.clipboard = xstrdup(xsel.primary);
if (xsel.primary != NULL) {
xsel.clipboard = xstrdup(xsel.primary);