summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAnas Nashif <nashif@intel.com>2008-04-17 01:20:43 +0000
committerAnas Nashif <nashif@intel.com>2008-04-17 01:20:43 +0000
commit818f85e916b06b37ac0e6ee55d064c6063d6c9ae (patch)
tree12633efc4271a622ae00dcf105694e0085dc22c2 /src
parent75ab51a219559fde6418fa5634db931f18062f8a (diff)
downloadwsmancli-818f85e916b06b37ac0e6ee55d064c6063d6c9ae.tar.gz
wsmancli-818f85e916b06b37ac0e6ee55d064c6063d6c9ae.tar.xz
wsmancli-818f85e916b06b37ac0e6ee55d064c6063d6c9ae.zip
fixed segfault with duplicate properties
Diffstat (limited to 'src')
-rw-r--r--src/wsman.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/wsman.c b/src/wsman.c
index dddc69d..0bafea8 100644
--- a/src/wsman.c
+++ b/src/wsman.c
@@ -478,9 +478,14 @@ static hash_t *wsman_options_get_properties(void)
while (properties != NULL && properties[c] != NULL) {
char *cc[3];
u_tokenize1(cc, 2, properties[c], '=');
- if (!hash_alloc_insert(h, cc[0], cc[1])) {
- debug("hash_alloc_insert failed");
- }
+ if (!hash_lookup(h, cc[0])) {
+ if (!hash_alloc_insert(h, cc[0], cc[1])) {
+ debug("hash_alloc_insert failed");
+ }
+ } else {
+ warn("duplicate not added to hash");
+ }
+
c++;
}
return h;