]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
maint: sort.c: fix syntax-check issue in recent commit
authorPádraig Brady <P@draigBrady.com>
Wed, 25 May 2022 08:59:29 +0000 (09:59 +0100)
committerPádraig Brady <P@draigBrady.com>
Wed, 25 May 2022 08:59:29 +0000 (09:59 +0100)
* src/sort.c (keycompare): Avoid useless if before free()
as detected with sc_avoid_if_before_free.

src/sort.c

index eedc410c363aa0a44014492981dc34138586ce65..dbe4560386fb80bb64506397714ecfde81366d00 100644 (file)
@@ -2706,8 +2706,7 @@ keycompare (struct line const *a, struct line const *b)
           ta[tlena] = enda;
           tb[tlenb] = endb;
 
-          if (allocated)
-            free (allocated);
+          free (allocated);
         }
       else if (ignore)
         {