summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/cvs/src
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2003-09-25 20:06:16 +0000
committermillert <millert@openbsd.org>2003-09-25 20:06:16 +0000
commit2a443c00a464266cf41601748df1c721f37b771a (patch)
tree301428e02a2139e6de50ea5d38ea385c7069060e /gnu/usr.bin/cvs/src
parentReturn immediately if argument to BN_sub_word is zero. (diff)
downloadwireguard-openbsd-2a443c00a464266cf41601748df1c721f37b771a.tar.xz
wireguard-openbsd-2a443c00a464266cf41601748df1c721f37b771a.zip
Free buffer and set it to NULL on error lest it be used.
Fixes a crash when MALLOC_OPTIONS includes 'J' found by david@.
Diffstat (limited to 'gnu/usr.bin/cvs/src')
-rw-r--r--gnu/usr.bin/cvs/src/rcs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gnu/usr.bin/cvs/src/rcs.c b/gnu/usr.bin/cvs/src/rcs.c
index 6fd2aacd005..ac060e26e2f 100644
--- a/gnu/usr.bin/cvs/src/rcs.c
+++ b/gnu/usr.bin/cvs/src/rcs.c
@@ -8427,6 +8427,11 @@ make_file_label (path, rev, rcs)
(void) tm_to_internet (datebuf, wm);
(void) sprintf (label, "-L%s\t%s", path, datebuf);
}
+ else
+ {
+ free(label);
+ label = NULL;
+ }
}
return label;
}