diff options
| author | Anas Nashif <nashif@intel.com> | 2008-04-17 01:20:43 +0000 |
|---|---|---|
| committer | Anas Nashif <nashif@intel.com> | 2008-04-17 01:20:43 +0000 |
| commit | 818f85e916b06b37ac0e6ee55d064c6063d6c9ae (patch) | |
| tree | 12633efc4271a622ae00dcf105694e0085dc22c2 /src | |
| parent | 75ab51a219559fde6418fa5634db931f18062f8a (diff) | |
fixed segfault with duplicate properties
Diffstat (limited to 'src')
| -rw-r--r-- | src/wsman.c | 11 |
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; |
