Fixed segmentation fault in out of memory situation

This commit is contained in:
Tatsuhiro Tsujikawa 2012-04-06 23:35:30 +09:00
parent d2b189e573
commit c89fc13c80
1 changed files with 1 additions and 0 deletions

View File

@ -105,6 +105,7 @@ static spdylay_map_entry* insert_recur(spdylay_map_entry *entry,
entry = spdylay_map_entry_new(key, val); entry = spdylay_map_entry_new(key, val);
if(entry == NULL) { if(entry == NULL) {
*error = SPDYLAY_ERR_NOMEM; *error = SPDYLAY_ERR_NOMEM;
return NULL;
} }
} else if(key == entry->key) { } else if(key == entry->key) {
*error = SPDYLAY_ERR_INVALID_ARGUMENT; *error = SPDYLAY_ERR_INVALID_ARGUMENT;