From 59f1edbca7c01a2c48f08d19e4cbf1cdf8ce5c89 Mon Sep 17 00:00:00 2001 From: Nelson Ferreira Date: Fri, 24 Feb 2012 16:10:44 -0500 Subject: [PATCH] Coverity: CID 610-DEAD CODE 611-UNUSED VALUE * lib-src/etags.c (process_file_name): compr was not being used before anyway so just remove the assignment from the if statement. * lib-src/etags.c (process_file_name): only make compressed_value NULL if it was previously not null. But still free it. This means that after the free we CANNOT dereference it. Signed-off-by: Nelson Ferreira --- lib-src/etags.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib-src/etags.c b/lib-src/etags.c index 62e8959..8fcc2e9 100644 --- a/lib-src/etags.c +++ b/lib-src/etags.c @@ -1531,7 +1531,7 @@ language *lang; error ("skipping inclusion of %s in self.", file); return; } - if ((compr = get_compressor_from_suffix (file, &ext)) == NULL) + if ( get_compressor_from_suffix (file, &ext) == NULL) { real_name = uncompressed_name = savestr (file); } @@ -1578,14 +1578,14 @@ language *lang; if ( inf == NULL ) { /* Reset real_name and try with a different name. */ free(compressed_name); - compressed_name = NULL; real_name = NULL; if (compressed_name != NULL) /* try with the given suffix */ { + compressed_name = NULL; real_name = uncompressed_name; } - else if ( compr->suffix != NULL ) + else if ( compr && compr->suffix != NULL ) /* try all possible suffixes */ { compressed_name = concat (file, ".", compr->suffix); -- 2.25.1