summaryrefslogtreecommitdiff
path: root/isofs/rr.c
diff options
context:
space:
mode:
authorMarcus Brinkmann <marcus@gnu.org>2001-01-07 17:06:26 +0000
committerMarcus Brinkmann <marcus@gnu.org>2001-01-07 17:06:26 +0000
commit1b062b32391b5ec34652853eddaa79ab9d625cc1 (patch)
tree5bb37887def6090ac81768871deaededab369c22 /isofs/rr.c
parent1f2c071fb4b9f8f9b3184ecd4f05bb6dde830984 (diff)
2000-12-21 Marcus Brinkmann <marcus@gnu.org>
* rr.c (rrip_work): Use strdup instead malloc and strcpy. Assert that strdup and malloc (for rr->trans) succeeds. * pager.c: Include <errno.h>. (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 <i_khavki@alcor.concordia.ca>.
Diffstat (limited to 'isofs/rr.c')
-rw-r--r--isofs/rr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/isofs/rr.c b/isofs/rr.c
index b069a831..58e8fa98 100644
--- a/isofs/rr.c
+++ b/isofs/rr.c
@@ -301,8 +301,8 @@ rrip_work (struct dirrect *dr, struct rrip_lookup *rr,
rr->valid |= VALID_NM;
if (name != nmbuf)
{
- rr->name = malloc (namelen + 1);
- strcpy (rr->name, name);
+ rr->name = strdup (name);
+ assert (rr->name);
}
else
{
@@ -567,6 +567,7 @@ rrip_work (struct dirrect *dr, struct rrip_lookup *rr,
rr->translen = tr->len;
rr->trans = malloc (rr->translen);
+ assert (rr->trans);
memcpy (tr->data, rr->trans, rr->translen);
rr->valid |= VALID_TR;