From 1b062b32391b5ec34652853eddaa79ab9d625cc1 Mon Sep 17 00:00:00 2001 From: Marcus Brinkmann Date: Sun, 7 Jan 2001 17:06:26 +0000 Subject: 2000-12-21 Marcus Brinkmann * rr.c (rrip_work): Use strdup instead malloc and strcpy. Assert that strdup and malloc (for rr->trans) succeeds. * pager.c: Include . (create_disk_pager): If malloc fails, exit with error. * main.c (read_sblock): Fail if malloc does. * inode.c (diskfs_cached_lookup): When allocating memory for dn or np fails, release spinlock, rrip (and allocated memory) and return ENOMEM. (load_inode): Likewise (but no rrip). Also, if *npp is non-zero, release diskfs_node_refcnt_lock before returning. Reported by Igor Khavkine . --- isofs/main.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'isofs/main.c') diff --git a/isofs/main.c b/isofs/main.c index beca281d..37f8a007 100644 --- a/isofs/main.c +++ b/isofs/main.c @@ -101,6 +101,8 @@ read_sblock () error (1, 0, "Could not find valid superblock"); sblock = malloc (sizeof (struct sblock)); + if (!sblock) + error (1, errno, "Could not allocate memory for superblock"); bcopy (sb, sblock, sizeof (struct sblock)); diskfs_end_catch_exception (); -- cgit v1.2.3