From: Dmitry V. Levin Date: Wed, 12 May 2021 15:00:00 +0000 (+0000) Subject: elfcompress: remove redundant assignment X-Git-Tag: elfutils-0.185~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=806c1f7a0d08ae2be40b39773ddf16ea5c8a1128;p=thirdparty%2Felfutils.git elfcompress: remove redundant assignment At the point of "Nothing to do" fnew variable has not been assigned after initialization, so it does not have to be reset to NULL. Note that any reset of fnew to NULL has to preceded with free(fnew). Fixes: ed62996defc6 ("elfcompress: Don't rewrite file if no section data needs to be updated.") --- diff --git a/src/ChangeLog b/src/ChangeLog index 47c7eb79e..de130f792 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2021-05-12 Dmitry V. Levin + * elfcompress.c (process_file): Remove redundant assignment in case of + "Nothing to do". + * elfcompress.c (process_file): Set res to 0 in case of "Nothing to do". 2021-04-19 Martin Liska diff --git a/src/elfcompress.c b/src/elfcompress.c index 7340e878b..05f3bc2ca 100644 --- a/src/elfcompress.c +++ b/src/elfcompress.c @@ -521,7 +521,6 @@ process_file (const char *fname) { if (verbose > 0) printf ("Nothing to do.\n"); - fnew = NULL; res = 0; goto cleanup; }