From 8acdfc3d6d124581d0b624e61e0047f576eb4748 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Tue, 26 Apr 2011 16:33:44 +0200 Subject: [PATCH] fd: Allow passing NULL to para_munmap(). This patch makes para_munmap succeed with return value 0 if the passed "start" pointer is NULL. This allows to simplify the code in the callers a bit, similar to free(NULL). --- fd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fd.c b/fd.c index 6f9266f4..ea16bdda 100644 --- a/fd.c +++ b/fd.c @@ -563,6 +563,9 @@ out: int para_munmap(void *start, size_t length) { int err; + + if (!start) + return 0; if (munmap(start, length) >= 0) return 1; err = errno; -- 2.39.5