From 08902e0496722d74da35dc74b541ab53c5c0e689 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 25 Sep 2003 20:06:17 +0000 Subject: Free buffer and set it to NULL on error lest it be used. Fixes a crash when MALLOC_OPTIONS includes 'J' found by david@. --- gnu/usr.bin/cvs/src/rcs.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'gnu') 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; } -- cgit v1.2.3