From c510c225cd815873e5489d3e0702d5b1d6124125 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 13 Aug 2007 22:41:39 +0200 Subject: [PATCH] Don't try to avoid "free (x)" when x is NULL. * libparted/arch/linux.c (linux_read): Part of http://git.debian.org/?p=parted/parted.git;a=commitdiff;h=080d3e7078 changed this: free(diobuf); to this: if (diobuf) free(diobuf); Yet, free doesn't have any problem with NULL. Some very old (non-POSIX) implementations did (like SunOS4), but even for them, gnulib's lib/free.c protects us. Signed-off-by: Jim Meyering --- libparted/arch/linux.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libparted/arch/linux.c b/libparted/arch/linux.c index f1f6aaa..648bd2b 100644 --- a/libparted/arch/linux.c +++ b/libparted/arch/linux.c @@ -1530,8 +1530,7 @@ linux_read (const PedDevice* dev, void* buffer, PedSector start, } } - if (diobuf) - free(diobuf); + free (diobuf); return 1; } -- 2.11.0