]> Savannah Git Hosting - gnulib.git/commitdiff
vasnprintf: Simplify a free() call.
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 1 May 2022 20:38:50 +0000 (22:38 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 1 May 2022 20:38:50 +0000 (22:38 +0200)
* lib/vasnprintf.c (divide): Just call
free (x) instead of doing ‘if (x != NULL) free (x);’.

ChangeLog
lib/vasnprintf.c

index 7c7ed1314168a94490a3c4052b85db1f6a76f62c..808b3756e0685443695b58633788023c80c24afc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-05-01  Paul Eggert  <eggert@cs.ucla.edu>
+
+       vasnprintf: Simplify a free() call.
+       * lib/vasnprintf.c (divide): Just call
+       free (x) instead of doing ‘if (x != NULL) free (x);’.
+
 2022-04-30  Bruno Haible  <bruno@clisp.org>
 
        string: Avoid syntax error on glibc systems with GCC 11.
index 485745243fbba8c9cf025ba5d9cd7e0cb04e34c5..23933806dfce16d5c37debb34cfe9223a64faf31 100644 (file)
@@ -915,8 +915,7 @@ divide (mpn_t a, mpn_t b, mpn_t *q)
       q_ptr[q_len++] = 1;
     }
   keep_q:
-  if (tmp_roomptr != NULL)
-    free (tmp_roomptr);
+  free (tmp_roomptr);
   q->limbs = q_ptr;
   q->nlimbs = q_len;
   return roomptr;