iscsi-scstd: Fix code for replacing an attribute value (merge r4545 from trunk)

git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.2.x@4581 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2012-11-03 14:15:23 +00:00
parent 5b106ecf63
commit 917b56374d
+1 -2
View File
@@ -194,8 +194,6 @@ int iscsi_attr_replace(struct __qelem *attrs_list, const char *sysfs_name,
a = iscsi_attr_lookup_by_key(attrs_list, key);
list_add_tail(attr, attrs_list);
if ((a != NULL) && (a != attr)) {
log_error("Attr %s (sysfs_name %s) already exists\n", key,
a->sysfs_name);
@@ -215,6 +213,7 @@ int iscsi_attr_replace(struct __qelem *attrs_list, const char *sysfs_name,
if (new_val == NULL) {
log_error("Unable to duplicate attr_value %s", val);
res = -ENOMEM;
free(new_key);
goto out;
}
} else