Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libm/gen Remove redundant null check before free()



details:   https://anonhg.NetBSD.org/src/rev/b7de5d49c4d6
branches:  trunk
changeset: 822207:b7de5d49c4d6
user:      maya <maya%NetBSD.org@localhost>
date:      Tue Mar 07 11:15:08 2017 +0000

description:
Remove redundant null check before free()
It is guaranteed to be fine also by C99

diffstat:

 lib/libm/gen/nan.c |  7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diffs (28 lines):

diff -r 8e97898cdf05 -r b7de5d49c4d6 lib/libm/gen/nan.c
--- a/lib/libm/gen/nan.c        Tue Mar 07 01:53:53 2017 +0000
+++ b/lib/libm/gen/nan.c        Tue Mar 07 11:15:08 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: nan.c,v 1.2 2008/04/28 20:23:01 martin Exp $ */
+/* $NetBSD: nan.c,v 1.3 2017/03/07 11:15:08 maya Exp $ */
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #if defined(LIBM_SCCS) && !defined(lint) && !defined(NAN_FUNCTION)
-__RCSID("$NetBSD: nan.c,v 1.2 2008/04/28 20:23:01 martin Exp $");
+__RCSID("$NetBSD: nan.c,v 1.3 2017/03/07 11:15:08 maya Exp $");
 #endif /* LIBM_SCCS and not lint */
 
 #include <assert.h>
@@ -78,8 +78,7 @@
 
        res = NAN_STRTOD(nstr, NULL);
 
-       if (buf != NULL)
-               free(buf);
+       free(buf);
 
        return res;
 }



Home | Main Index | Thread Index | Old Index