Merge branch 'develop' of https://github.com/mariadb-corporation/MaxScale into develop
This commit is contained in:
@ -902,8 +902,10 @@ static void *uh_keydup(void* key) {
|
||||
|
||||
rval->user = strdup(current_key->user);
|
||||
|
||||
if (rval->user == NULL)
|
||||
if (rval->user == NULL) {
|
||||
free(rval);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memcpy(&rval->ipv4, ¤t_key->ipv4, sizeof(struct sockaddr_in));
|
||||
memcpy(&rval->netmask, ¤t_key->netmask, sizeof(int));
|
||||
|
||||
@ -258,7 +258,9 @@ hashtable_add(HASHTABLE *table, void *key, void *value)
|
||||
|
||||
/* check succesfull key copy */
|
||||
if ( ptr->key == NULL) {
|
||||
free(ptr);
|
||||
hashtable_write_unlock(table);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -269,9 +271,11 @@ hashtable_add(HASHTABLE *table, void *key, void *value)
|
||||
if ( ptr->value == NULL) {
|
||||
/* remove the key ! */
|
||||
table->kfreefn(ptr->key);
|
||||
free(ptr);
|
||||
|
||||
/* value not copied, return */
|
||||
hashtable_write_unlock(table);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -279,6 +283,7 @@ hashtable_add(HASHTABLE *table, void *key, void *value)
|
||||
table->entries[hashkey % table->hashsize] = ptr;
|
||||
}
|
||||
hashtable_write_unlock(table);
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user