Whamcloud - gitweb
git://git.whamcloud.com
/
tools
/
e2fsprogs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
47b8941
)
libext2fs: fix memory leaks in ext2fs_xattr_set()
author
Theodore Ts'o
<tytso@mit.edu>
Tue, 31 Jan 2017 20:29:57 +0000
(15:29 -0500)
committer
Theodore Ts'o
<tytso@mit.edu>
Tue, 31 Jan 2017 20:29:57 +0000
(15:29 -0500)
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
lib/ext2fs/ext_attr.c
patch
|
blob
|
history
diff --git
a/lib/ext2fs/ext_attr.c
b/lib/ext2fs/ext_attr.c
index
0314f9f
..
ce2f48f
100644
(file)
--- a/
lib/ext2fs/ext_attr.c
+++ b/
lib/ext2fs/ext_attr.c
@@
-1186,17
+1186,17
@@
errcode_t ext2fs_xattr_set(struct ext2_xattr_handle *handle,
/* Expand array, append slot */
err = ext2fs_xattrs_expand(handle, 4);
if (err)
-
return err
;
+
goto errout
;
x = handle->attrs + handle->length - 4;
err = ext2fs_get_mem(strlen(key) + 1, &x->name);
if (err)
-
return err
;
+
goto errout
;
strcpy(x->name, key);
err = ext2fs_get_mem(value_len, &x->value);
if (err)
-
return err
;
+
goto errout
;
memcpy(x->value, value, value_len);
x->value_len = value_len;
handle->dirty = 1;