From: Paul Eggert Date: Sun, 1 May 2022 20:38:50 +0000 (+0200) Subject: vasnprintf: Simplify a free() call. X-Git-Tag: v1.0~2304 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=da95c0389f5e8c668d6c8c16462669135f02fb38;p=gnulib.git vasnprintf: Simplify a free() call. * lib/vasnprintf.c (divide): Just call free (x) instead of doing ‘if (x != NULL) free (x);’. --- diff --git a/ChangeLog b/ChangeLog index 7c7ed13141..808b3756e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2022-05-01 Paul Eggert + + 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 string: Avoid syntax error on glibc systems with GCC 11. diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index 485745243f..23933806df 100644 --- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -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;