summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2003-09-25 20:06:17 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2003-09-25 20:06:17 +0000
commit08902e0496722d74da35dc74b541ab53c5c0e689 (patch)
treeca2847e9337b2c9328322b3b50b95fc67026db5c
parentb2ada990e5f93d5c2514e8bda5b45d16eb58f136 (diff)
Free buffer and set it to NULL on error lest it be used.
Fixes a crash when MALLOC_OPTIONS includes 'J' found by david@.
-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;
}