From 970c84822bf6483a7d7112005708295d5e67461f Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Sun, 1 Apr 2001 01:39:47 +0000 Subject: 2001-03-28 Neal H Walfield * dir-chg.c (diskfs_S_dir_notice_changes): Check what malloc returns. * peropen-make.c (diskfs_make_peropen): Likewise. --- libdiskfs/dir-chg.c | 7 ++++++- libdiskfs/peropen-make.c | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'libdiskfs') diff --git a/libdiskfs/dir-chg.c b/libdiskfs/dir-chg.c index 16eb26f4..0e2f4c8a 100644 --- a/libdiskfs/dir-chg.c +++ b/libdiskfs/dir-chg.c @@ -1,5 +1,5 @@ /* Notifications of directory changes. - Copyright (C) 1994, 1995, 1998 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1998, 2001 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -44,6 +44,11 @@ diskfs_S_dir_notice_changes (struct protid *cred, return err; } req = malloc (sizeof (struct modreq)); + if (! req) + { + mutex_unlock (&np->lock); + return ENOMEM; + } req->port = notify; req->next = np->dirmod_reqs; np->dirmod_reqs = req; diff --git a/libdiskfs/peropen-make.c b/libdiskfs/peropen-make.c index 887658c7..a49feaf9 100644 --- a/libdiskfs/peropen-make.c +++ b/libdiskfs/peropen-make.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1994, 1997, 1999 Free Software Foundation + Copyright (C) 1994, 1997, 1999, 2001 Free Software Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -25,6 +25,9 @@ diskfs_make_peropen (struct node *np, int flags, struct peropen *context) { struct peropen *po = malloc (sizeof (struct peropen)); + if (! po) + return NULL; + po->filepointer = 0; po->lock_status = LOCK_UN; po->refcnt = 0; -- cgit v1.2.3