diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2024-03-01 20:32:01 -0500 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2024-03-02 16:58:37 -0500 |
commit | 95e93cfd56c8dec57a3bb2627d7714944713c37a (patch) | |
tree | 71d0e47415470d3afef3b0a5fdef95372a84d172 | |
parent | 28b5ce87555b5c85f240895c64818015d134b3b7 (diff) |
add check for null pointer, avoid dereferencing
Signed-off-by: Thomas E. Dickey <dickey@invisible-island.net>
-rw-r--r-- | src/TextAction.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/TextAction.c b/src/TextAction.c index b031d49..59ac6ac 100644 --- a/src/TextAction.c +++ b/src/TextAction.c @@ -1198,7 +1198,7 @@ _LoseSelection(Widget w, Atom *selection, char **contents _X_UNUSED, int *length tail = kill_ring; kill_ring = kill_ring->next; } - if (kill_ring->refcount == 0) { + if (tail != NULL && kill_ring->refcount == 0) { --num_kill_rings; tail->next = NULL; XtFree(kill_ring->contents); |