Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/blacklist/bin Ordinarily, the continue clause o...



details:   https://anonhg.NetBSD.org/src/rev/40cb5a3b5301
branches:  trunk
changeset: 460874:40cb5a3b5301
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Nov 06 21:01:17 2019 +0000

description:
Ordinarily, the continue clause of the for-loop would free 'line.'  In this
case we instead return early, missing the free.  Add an explicit free to
avoid the leak. Found via coverity.

>From Conrad Meyer @ FreeBSD r331230

diffstat:

 external/bsd/blacklist/bin/conf.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 8bc0bceb455b -r 40cb5a3b5301 external/bsd/blacklist/bin/conf.c
--- a/external/bsd/blacklist/bin/conf.c Wed Nov 06 20:50:01 2019 +0000
+++ b/external/bsd/blacklist/bin/conf.c Wed Nov 06 21:01:17 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: conf.c,v 1.24 2016/04/04 15:52:56 christos Exp $       */
+/*     $NetBSD: conf.c,v 1.25 2019/11/06 21:01:17 christos Exp $       */
 
 /*-
  * Copyright (c) 2015 The NetBSD Foundation, Inc.
@@ -33,7 +33,7 @@
 #endif
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: conf.c,v 1.24 2016/04/04 15:52:56 christos Exp $");
+__RCSID("$NetBSD: conf.c,v 1.25 2019/11/06 21:01:17 christos Exp $");
 
 #include <stdio.h>
 #ifdef HAVE_LIBUTIL_H
@@ -1119,6 +1119,7 @@
                                confset_free(&lc);
                                confset_free(&rc);
                                fclose(fp);
+                               free(line);
                                return;
                        }
                }



Home | Main Index | Thread Index | Old Index