bug-inetutils
[Top][All Lists]
Advanced

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

[bug-inetutils] syntax-check: sc_cast_of_argument_to_free


From: Simon Josefsson
Subject: [bug-inetutils] syntax-check: sc_cast_of_argument_to_free
Date: Fri, 13 Nov 2009 18:07:31 +0100
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.1 (gnu/linux)

I will probably regret this, but now that maintainer-makefile is used, I
ran 'make syntax-check' and started looking into fixing what it reports.
I have pushed the patch below to fix this:

hostname/hostname.c:228:  free ((void *) hostname_new);
inetd/inetd.c:1308:      free ((char *) sep);
maint.mk: don't cast free argument
make: *** [sc_cast_of_argument_to_free] Error 1

/Simon

>From c198e79fa1b398c1f05a85d1d99314b63f05a10d Mon Sep 17 00:00:00 2001
From: Simon Josefsson <address@hidden>
Date: Fri, 13 Nov 2009 18:06:53 +0100
Subject: [PATCH] Fix syntax-check sc_cast_of_argument_to_free.

---
 ChangeLog           |    6 ++++++
 hostname/hostname.c |    2 +-
 inetd/inetd.c       |    2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 8b73928..782221e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-11-13  Simon Josefsson  <address@hidden>
+
+       * inetd/inetd.c (nextconfig): Fix syntax-check
+       sc_cast_of_argument_to_free.
+       * hostname/hostname.c (set_name): Likewise.
+
 2009-11-12  Simon Josefsson  <address@hidden>
 
        * bootstrap.conf (gnulib_modules): Add maintainer-makefile, to get
diff --git a/hostname/hostname.c b/hostname/hostname.c
index 271ffd1..9f399f3 100644
--- a/hostname/hostname.c
+++ b/hostname/hostname.c
@@ -225,7 +225,7 @@ set_name (const hostname_arguments *const args)
   if (status == -1)
     error (EXIT_FAILURE, errno, "sethostname");
 
-  free ((void *) hostname_new);
+  free (hostname_new);
   return;
 }
 
diff --git a/inetd/inetd.c b/inetd/inetd.c
index f4637c9..0b6d6d9 100644
--- a/inetd/inetd.c
+++ b/inetd/inetd.c
@@ -1305,7 +1305,7 @@ nextconfig (const char *file)
       if (debug)
        print_service ("FREE", sep);
       freeconfig (sep);
-      free ((char *) sep);
+      free (sep);
     }
   signal_unblock (&sigstatus);
 }
-- 
1.6.5.2





reply via email to

[Prev in Thread] Current Thread [Next in Thread]