inode->i_security_id = -1;
/*inode->i_nlink = 0;*/
inode->i_not_rpfixed = 1;
- INIT_LIST_HEAD(&inode->i_list);
INIT_LIST_HEAD(&inode->i_dentry);
inode->i_streams = inode->i_embedded_streams;
if (set_timestamps) {
FREE(inode->i_streams);
if (inode->i_extra)
FREE(inode->i_extra);
- /* HACK: This may instead delete the inode from i_list, but hlist_del()
- * behaves the same as list_del(). */
if (!hlist_unhashed(&inode->i_hlist))
hlist_del(&inode->i_hlist);
FREE(inode);
const void *data, size_t size,
struct blob_table *blob_table)
{
- struct blob_descriptor *new_blob;
+ struct blob_descriptor *new_blob = NULL;
- new_blob = new_blob_from_data_buffer(data, size, blob_table);
- if (!new_blob)
- return false;
+ if (size) {
+ new_blob = new_blob_from_data_buffer(data, size, blob_table);
+ if (!new_blob)
+ return false;
+ }
inode_replace_stream_blob(inode, strm, new_blob, blob_table);
return true;
struct blob_table *blob_table)
{
struct wim_inode_stream *strm;
- struct blob_descriptor *blob;
+ struct blob_descriptor *blob = NULL;
strm = inode_add_stream(inode, stream_type, stream_name, NULL);
if (!strm)
return false;
- blob = new_blob_from_data_buffer(data, size, blob_table);
- if (!blob) {
- inode_remove_stream(inode, strm, blob_table);
- return false;
+ if (size) {
+ blob = new_blob_from_data_buffer(data, size, blob_table);
+ if (unlikely(!blob)) {
+ inode_remove_stream(inode, strm, blob_table);
+ return false;
+ }
}
inode_set_stream_blob(inode, strm, blob);