artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f6ce44e
)
plug another leak in addctag; found + ok tb@
author
op
<op@openbsd.org>
Wed, 22 Mar 2023 22:09:37 +0000
(22:09 +0000)
committer
op
<op@openbsd.org>
Wed, 22 Mar 2023 22:09:37 +0000
(22:09 +0000)
usr.bin/mg/tags.c
patch
|
blob
|
history
diff --git
a/usr.bin/mg/tags.c
b/usr.bin/mg/tags.c
index
cd87ee5
..
0e44c0f
100644
(file)
--- a/
usr.bin/mg/tags.c
+++ b/
usr.bin/mg/tags.c
@@
-1,4
+1,4
@@
-/* $OpenBSD: tags.c,v 1.2
2 2023/03/22 19:42:41
op Exp $ */
+/* $OpenBSD: tags.c,v 1.2
3 2023/03/22 22:09:37
op Exp $ */
/*
* This file is in the public domain.
@@
-388,7
+388,8
@@
addctag(char *s)
if (*l == '\0')
goto cleanup;
t->pat = strip(l, strlen(l));
- RB_INSERT(tagtree, &tags, t);
+ if (RB_INSERT(tagtree, &tags, t) != NULL)
+ goto cleanup;
return (TRUE);
cleanup:
free(t);