Skip to content

Commit 6c555ed

Browse files
committed
bugfix: bugs in the error handling for pure C API functions for shared dict. thanks Xiaochen Wang for the patch in openresty#365.
1 parent c11ceb4 commit 6c555ed

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/ngx_http_lua_shdict.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,6 +1270,7 @@ ngx_http_lua_shared_dict_get(ngx_shm_zone_t *zone, u_char *key_data,
12701270
if (value->value.s.data == NULL || value->value.s.len == 0) {
12711271
ngx_log_error(NGX_LOG_ERR, ngx_cycle->log, 0, "no string buffer "
12721272
"initialized");
1273+
ngx_shmtx_unlock(&ctx->shpool->mutex);
12731274
return NGX_ERROR;
12741275
}
12751276

@@ -1721,6 +1722,7 @@ ngx_http_lua_ffi_shdict_get(ngx_shm_zone_t *zone, u_char *key,
17211722
"bad value type found for key %*s in "
17221723
"shared_dict %V: %d", key_len, key, &name,
17231724
*value_type);
1725+
return NGX_ERROR;
17241726
}
17251727

17261728
*user_flags = sd->user_flags;

0 commit comments

Comments
 (0)