Source-Changes-HG archive

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

[src/netbsd-9]: src/usr.sbin/sysinst Pull up following revision(s) (requested...



details:   https://anonhg.NetBSD.org/src/rev/7c62f9a9b326
branches:  netbsd-9
changeset: 458215:7c62f9a9b326
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Sun Aug 18 13:32:50 2019 +0000

description:
Pull up following revision(s) (requested by martin in ticket #89):
        usr.sbin/sysinst/checkrc.c: revision 1.2
Fix memory leak (found by MKSANITIZER=yes build).

diffstat:

 usr.sbin/sysinst/checkrc.c |  10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diffs (31 lines):

diff -r 6de92ebda522 -r 7c62f9a9b326 usr.sbin/sysinst/checkrc.c
--- a/usr.sbin/sysinst/checkrc.c        Sun Aug 18 13:31:21 2019 +0000
+++ b/usr.sbin/sysinst/checkrc.c        Sun Aug 18 13:32:50 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: checkrc.c,v 1.1 2014/07/26 19:30:44 dholland Exp $ */
+/* $NetBSD: checkrc.c,v 1.1.30.1 2019/08/18 13:32:50 msaitoh Exp $ */
 
 /*-
  * Copyright (c) 2012 The NetBSD Foundation, Inc.
@@ -81,6 +81,7 @@
 check(const char *varname, int filetocheck)
 {
        char *buf;
+       int rv;
 
        create_script(varname, filetocheck);
 
@@ -98,10 +99,9 @@
                fflush(logfp);
        }
 
-       if (strncmp(buf, "YES", strlen("YES")) == 0)
-               return 1;
-       else
-               return 0;
+       rv = strncmp(buf, "YES", strlen("YES")) == 0;
+       free(buf);
+       return rv;
 }
 
 int



Home | Main Index | Thread Index | Old Index