summaryrefslogtreecommitdiffstats
path: root/paste.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2023-02-07 14:01:11 +0000
committerThomas Adam <thomas@xteddy.org>2023-02-07 14:01:11 +0000
commit023b0f76c3712281e30041f086b91c89f9525d33 (patch)
tree4d14a00e3b1196cb93f4cd71c8470094e2f54e16 /paste.c
parentddaeebc2133b991aacac78dea672add480895465 (diff)
parent1262e685b827a155d68e92f44077bfd1d44f1812 (diff)
Merge branch 'obsd-master'
Diffstat (limited to 'paste.c')
-rw-r--r--paste.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/paste.c b/paste.c
index 84cdecb0..608ac9c6 100644
--- a/paste.c
+++ b/paste.c
@@ -240,11 +240,8 @@ paste_rename(const char *oldname, const char *newname, char **cause)
}
pb_new = paste_get_name(newname);
- if (pb_new != NULL) {
- if (cause != NULL)
- xasprintf(cause, "buffer %s already exists", newname);
- return (-1);
- }
+ if (pb_new != NULL)
+ paste_free(pb_new);
RB_REMOVE(paste_name_tree, &paste_by_name, pb);