Remove useless check as data can't be NULL at this point

This commit is contained in:
Mukund Sivaraman 2008-08-24 10:45:29 +05:30
parent 039273c134
commit 90c1bb4b73

View File

@ -215,16 +215,12 @@ hashmap_insert(hashmap_t map, const char *key, const void *data, size_t len)
if (!key_copy)
return -ENOMEM;
if (data) {
data_copy = safemalloc(len);
if (!data_copy) {
safefree(key_copy);
return -ENOMEM;
}
memcpy(data_copy, data, len);
} else {
data_copy = NULL;
}
data_copy = safemalloc(len);
if (!data_copy) {
safefree(key_copy);
return -ENOMEM;
}
memcpy(data_copy, data, len);
ptr = safemalloc(sizeof(struct hashentry_s));
if (!ptr) {