Skip to content

Commit

Permalink
Fix #24, segfault when insufficient memory
Browse files Browse the repository at this point in the history
(cherry picked from commit 1c1e3d9)
  • Loading branch information
jiangwenyuan committed Aug 15, 2018
1 parent 8c254fa commit d61686a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/nuster/cache/engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,7 @@ void nst_cache_create(struct nst_cache_ctx *ctx, char *key, uint64_t hash) {
entry->state = NST_CACHE_ENTRY_STATE_CREATING;
entry->data = nst_cache_data_new();
if(!entry->data) {
entry->state = NST_CACHE_ENTRY_STATE_INVALID;
ctx->state = NST_CACHE_CTX_STATE_BYPASS;
nuster_shctx_unlock(&nuster.cache->dict[0]);
return;
Expand Down

0 comments on commit d61686a

Please sign in to comment.