Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/envstat Fix double free, when requesting an invalid...



details:   https://anonhg.NetBSD.org/src/rev/0dbed09ce7a5
branches:  trunk
changeset: 752064:0dbed09ce7a5
user:      njoly <njoly%NetBSD.org@localhost>
date:      Fri Feb 12 14:26:27 2010 +0000

description:
Fix double free, when requesting an invalid sensor.

diffstat:

 usr.sbin/envstat/envstat.c |  6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diffs (27 lines):

diff -r 5e1769536914 -r 0dbed09ce7a5 usr.sbin/envstat/envstat.c
--- a/usr.sbin/envstat/envstat.c        Fri Feb 12 12:29:10 2010 +0000
+++ b/usr.sbin/envstat/envstat.c        Fri Feb 12 14:26:27 2010 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: envstat.c,v 1.75 2010/02/12 05:02:40 cnst Exp $ */
+/* $NetBSD: envstat.c,v 1.76 2010/02/12 14:26:27 njoly Exp $ */
 
 /*-
  * Copyright (c) 2007, 2008 Juan Romero Pardines.
@@ -27,7 +27,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: envstat.c,v 1.75 2010/02/12 05:02:40 cnst Exp $");
+__RCSID("$NetBSD: envstat.c,v 1.76 2010/02/12 14:26:27 njoly Exp $");
 #endif /* not lint */
 
 #include <stdio.h>
@@ -436,8 +436,6 @@
                }
                rval = check_sensors(str);
                free(str);
-               if (rval)
-                       free(str);
        }
        if ((flags & ENVSYS_LFLAG) == 0 && (flags & ENVSYS_DFLAG) == 0)
                print_sensors();



Home | Main Index | Thread Index | Old Index