]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
elfcompress: remove redundant assignment
authorDmitry V. Levin <ldv@altlinux.org>
Wed, 12 May 2021 15:00:00 +0000 (15:00 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 12 May 2021 15:00:00 +0000 (15:00 +0000)
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.")
src/ChangeLog
src/elfcompress.c

index 47c7eb79efee9c88b90d1bbd6feffad4283ab63f..de130f792c377f6910d91000ed2cf0ff251eafd5 100644 (file)
@@ -1,5 +1,8 @@
 2021-05-12  Dmitry V. Levin  <ldv@altlinux.org>
 
+       * 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  <mliska@suse.cz>
index 7340e878b48bddf0d0dcb7765967ab5882345cf5..05f3bc2ca772309ce93f3dea6e31f7e708bc68b9 100644 (file)
@@ -521,7 +521,6 @@ process_file (const char *fname)
     {
       if (verbose > 0)
        printf ("Nothing to do.\n");
-      fnew = NULL;
       res = 0;
       goto cleanup;
     }