Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ieee1394 memory leak, found by Mootja; it seems that...



details:   https://anonhg.NetBSD.org/src/rev/ec05b6f1a2c2
branches:  trunk
changeset: 824992:ec05b6f1a2c2
user:      maxv <maxv%NetBSD.org@localhost>
date:      Sun Jun 25 12:39:27 2017 +0000

description:
memory leak, found by Mootja; it seems that we should check the return
value of 'fw_bindadd' in several other places, but whatever

diffstat:

 sys/dev/ieee1394/fwdev.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r b294eedf2c65 -r ec05b6f1a2c2 sys/dev/ieee1394/fwdev.c
--- a/sys/dev/ieee1394/fwdev.c  Sun Jun 25 12:29:32 2017 +0000
+++ b/sys/dev/ieee1394/fwdev.c  Sun Jun 25 12:39:27 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fwdev.c,v 1.31 2016/11/20 22:47:39 riastradh Exp $     */
+/*     $NetBSD: fwdev.c,v 1.32 2017/06/25 12:39:27 maxv Exp $  */
 /*-
  * Copyright (c) 2003 Hidetoshi Shimokawa
  * Copyright (c) 1998-2002 Katsushi Kobayashi and Hidetoshi Shimokawa
@@ -37,7 +37,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: fwdev.c,v 1.31 2016/11/20 22:47:39 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: fwdev.c,v 1.32 2017/06/25 12:39:27 maxv Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -614,6 +614,8 @@
                            /* XXX */
                            PAGE_SIZE, PAGE_SIZE, 5, fc, (void *)fwb, fw_hand);
                        STAILQ_INSERT_TAIL(&d->binds, fwb, chlist);
+               } else {
+                       free(fwb, M_FW);
                }
                break;
 



Home | Main Index | Thread Index | Old Index