[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Small bug in libnetfs
From: |
Michael Oberg |
Subject: |
Re: Small bug in libnetfs |
Date: |
Tue, 19 Dec 2000 17:43:35 -0700 (MST) |
Shouldnt the patch read as follows?
This is my understanding:
Index: libnetfs/make-node.c
===================================================================
RCS file: /cvs/hurd/libnetfs/make-node.c,v
retrieving revision 1.4
diff -u -r1.4 make-node.c
--- libnetfs/make-node.c 1996/07/03 15:55:32 1.4
+++ libnetfs/make-node.c 2000/12/19 08:11:19
@@ -25,7 +25,9 @@
netfs_make_node (struct netnode *nn)
{
struct node *np = malloc (sizeof (struct node));
-
+ if (np == NULL)
+ return ENOMEM;
+
np->nn = nn;
mutex_init (&np->lock);
- Michael Oberg
oberg@adhocinc.com
>
>
> --3V7upXqbjpZ4EhLz
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: inline
>
> I came across a potential segfault in the libnetfs code.
>
> Here's the patch.
>
> Igor
>
> --3V7upXqbjpZ4EhLz
> Content-Type: text/plain; charset=us-ascii
> Content-Disposition: attachment; filename="my.diff"
>
> Index: libnetfs/make-node.c
> ===================================================================
> RCS file: /cvs/hurd/libnetfs/make-node.c,v
> retrieving revision 1.4
> diff -u -r1.4 make-node.c
> --- libnetfs/make-node.c 1996/07/03 15:55:32 1.4
> +++ libnetfs/make-node.c 2000/12/19 08:11:19
> @@ -25,7 +25,9 @@
> netfs_make_node (struct netnode *nn)
> {
> struct node *np = malloc (sizeof (struct node));
> -
> + if (!np)
> + return NULL;
> +
> np->nn = nn;
>
> mutex_init (&np->lock);
>
> --3V7upXqbjpZ4EhLz--
>
> _______________________________________________
> Bug-hurd mailing list
> Bug-hurd@gnu.org
> http://mail.gnu.org/mailman/listinfo/bug-hurd
>