summaryrefslogtreecommitdiff
path: root/ext4_utils/contents.c
diff options
context:
space:
mode:
authorDoug Zongker <dougz@google.com>2014-08-12 16:55:56 -0700
committerDoug Zongker <dougz@google.com>2014-08-12 16:55:56 -0700
commit9922135de65b717267d8173f61e360fbb9cf1ebd (patch)
treeeaa199f8a6927640c2e127b1fd947a2e8c2d2a96 /ext4_utils/contents.c
parentbec598e982301bf2714d37b14e312c9845c7cc0c (diff)
downloadextras-9922135de65b717267d8173f61e360fbb9cf1ebd.tar.gz
fix build
inode_allocate_file_extents should return NULL if allocation fails. Bug: 16984795 Change-Id: I7d2b9d61ca81f8e1869dbac3d8bde79bb5799fa9
Diffstat (limited to 'ext4_utils/contents.c')
-rw-r--r--ext4_utils/contents.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/ext4_utils/contents.c b/ext4_utils/contents.c
index fb3a38dc..3144de93 100644
--- a/ext4_utils/contents.c
+++ b/ext4_utils/contents.c
@@ -194,10 +194,11 @@ u32 make_file(const char *filename, u64 len)
if (len > 0) {
struct block_allocation* alloc = inode_allocate_file_extents(inode, len, filename);
-
- alloc->filename = strdup(filename);
- alloc->next = saved_allocation_head;
- saved_allocation_head = alloc;
+ if (alloc) {
+ alloc->filename = strdup(filename);
+ alloc->next = saved_allocation_head;
+ saved_allocation_head = alloc;
+ }
}
inode->i_mode = S_IFREG;