Source-Changes-HG archive

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

[src/trunk]: src/sbin/fsck Properly release the disk properties dictionary we...



details:   https://anonhg.NetBSD.org/src/rev/923da5087c38
branches:  trunk
changeset: 964815:923da5087c38
user:      martin <martin%NetBSD.org@localhost>
date:      Sun Aug 18 11:08:56 2019 +0000

description:
Properly release the disk properties dictionary we received via
ioctl.
Detected by leak sanitizer when building with MKSANITIZER=yes.

diffstat:

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

diffs (27 lines):

diff -r d6549e616398 -r 923da5087c38 sbin/fsck/partutil.c
--- a/sbin/fsck/partutil.c      Sun Aug 18 09:51:06 2019 +0000
+++ b/sbin/fsck/partutil.c      Sun Aug 18 11:08:56 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: partutil.c,v 1.15 2015/06/03 17:53:23 martin Exp $     */
+/*     $NetBSD: partutil.c,v 1.16 2019/08/18 11:08:56 martin Exp $     */
 
 /*-
  * Copyright (c) 2006 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: partutil.c,v 1.15 2015/06/03 17:53:23 martin Exp $");
+__RCSID("$NetBSD: partutil.c,v 1.16 2019/08/18 11:08:56 martin Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -131,6 +131,8 @@
                geom_dict = prop_dictionary_get(disk_dict, "geometry");
                dict2geom(geo, geom_dict);
        }
+       if (disk_dict != NULL)
+               prop_object_release(disk_dict);
 
        if (dkw == NULL)
                return 0;



Home | Main Index | Thread Index | Old Index