blob: Handle allocation failures in set xattr
Change-Id: Ida9361066e8b3117d1022379d75e290b11f86b52 Signed-off-by: Ben Walker <benjamin.walker@intel.com>
This commit is contained in:
parent
21ce0f4030
commit
d827cfbde6
@ -2221,11 +2221,10 @@ spdk_blob_md_set_xattr(struct spdk_blob *blob, const char *name, const void *val
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* This is probably all going to rewritten, so do not bother checking for failed
|
|
||||||
* allocations for now.
|
|
||||||
*/
|
|
||||||
xattr = calloc(1, sizeof(*xattr));
|
xattr = calloc(1, sizeof(*xattr));
|
||||||
|
if (!xattr) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
xattr->name = strdup(name);
|
xattr->name = strdup(name);
|
||||||
xattr->value_len = value_len;
|
xattr->value_len = value_len;
|
||||||
xattr->value = malloc(value_len);
|
xattr->value = malloc(value_len);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user