From 4689f51a9f2f733ba9ad4cfa92e26b8a2336b5c6 Mon Sep 17 00:00:00 2001 From: Xiang Xiao Date: Tue, 20 Apr 2021 20:00:13 +0800 Subject: [PATCH] Set token to the empty string if fail in read_next_token since read_rc_file always use token regardless pass or fail Signed-off-by: Xiang Xiao Change-Id: Idfcc7b2c02cf86f8ef289366307461af6c52b9cb --- dmalloc.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dmalloc.c b/dmalloc.c index 6d8c1a6..abbca97 100644 --- a/dmalloc.c +++ b/dmalloc.c @@ -429,9 +429,12 @@ static int read_next_token(FILE *infile, long *debug_p, if (found_b) { return 1; } - else { - return 0; + + if (token != NULL) { + token[0] = '\0'; } + + return 0; } /*